Note that there are some explanatory texts on larger screens.

plurals
  1. POFixing date in sheet (searching for string)
    text
    copied!<p>I have two columns with values such as:</p> <pre><code>5 - 11 octubre 2011 5 - 11 octubre 2011 5 - 11 octubre 2011 12 - 18 diciembre 2011 30 noviembre - 6 diciembre 2012 30 noviembre - 6 diciembre 2012 18 - 24 septiembre_2012 2012 18 - 24 septiembre_2012 2012 22 - 28 abril_2013 2013 22 - 28 abril_2013 2013 </code></pre> <p>I want to take the last day and put it together into one column such as:</p> <pre><code>2011/10/11 2011/10/11 2011/10/11 2011/12/18 2011/12/06 2011/12/06 2012/09/24 2012/09/24 2013/04/28 2013/04/28 </code></pre> <p>But I can't find a way to do so. Could anybody help me?</p> <p>Right now I have this: (the messed date is in D and year in I)</p> <pre><code>Sub Data() With ActiveSheet LASTROW = .Cells(.Rows.Count, "A").End(xlUp).Row End With For b = LASTROW To 1 Step -1 Cells(b, 4) = Application.Clean(Application.Trim(Cells(b, 4))) Next For i = 1 To LASTROW Valor = Right(Range("D2").Offset(i, 0).Value, 12) Numero = Right(Range("D2").Offset(i, 0).Value, 4) If InStr(1, Valor, "enero") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Enero" End If If InStr(1, Valor, "febrero") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Febrero" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "marzo") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Marzo" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "abril") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Abril" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "mayo") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Mayo" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "junio") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Junio" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "julio") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Julio" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "agosto") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Agosto" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "septiembre") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Septiembre" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "octubre") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Octubre" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "noviembre") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Noviembre" End If If InStr(1, ActiveSheet.Range("D2").Offset(i, 0).Value, "diciembre") &gt; 0 Then Range("E2").Offset(i, 0).Value = "Diciembre" End If Next i End Sub </code></pre> <p>I'm thinking about check if "Numero" is a number and if it is, I don't know how to delete it from the main string... If you guys could help me...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload