Hello, i have this worksheet
and i need to extract parts of the rows into the proper cells on the right. I have written this piece of code but i don't know how to stop the search function to the first result. It always find the last bracket and not the first, in order to stop.
Thanks!
Code:
[TABLE="width: 1431"]
<tbody>[TR]
[TD="colspan: 7"]DateTime,Name,Country,Volatility,Actual,Previous,Consensus[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Data[/TD]
[TD]Ora[/TD]
[TD]Nome[/TD]
[TD]Country[/TD]
[TD]Volatility[/TD]
[TD]Actual[/TD]
[TD]Previous[/TD]
[TD]Consensus[/TD]
[/TR]
[TR]
[TD="colspan: 5"]20121001 02:00:00{Labour Day}{Australia}{0}{}{}{}[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]20121001[/TD]
[TD="align: right"]02:00:00[/TD]
[TD]Labour Day}{Australi[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 5"]20121001 02:00:00{National Day}{China}{0}{}{}{}[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]20121001[/TD]
[TD="align: right"]02:00:00[/TD]
[TD]National Day}{Ch[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
and i need to extract parts of the rows into the proper cells on the right. I have written this piece of code but i don't know how to stop the search function to the first result. It always find the last bracket and not the first, in order to stop.
Code:
Public Sub CalendarSheet()Dim stringa As Variant, i As Integer
'Worksheets.Add After:=Sheets(1)
'ActiveSheet.Name = "Dati"
'nomi in Dati
'Range("A1").Value = "Data"
'Range("B1").Value = "Ora"
'Range("C1").Value = "Nome"
'Range("D1").Value = "Country"
'Range("E1").Value = "Volatility"
'Range("F1").Value = "Actual"
'Range("G1").Value = "Previous"
'Range("H1").Value = "Consensus"
'Range("A1:H1").EntireColumn.AutoFit
'Range("A1:H1").Copy
'sostituzione valori non corretti prima dei simboli valuta
'Worksheets("eventdates").Select
'Range("K1").Select
'ActiveSheet.Paste
Range("A1").Select
Cells.Replace What:="Â", Replacement:="", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False
'sistemare in colonne a fianco i dati
i = 2
For Each stringa In Range("A2:A720")
Range("K" & i).Value = Left(stringa, 8)
Range("L" & i).Value = Mid(stringa, 10, 8)
Range("M" & i).Value = Mid(stringa, WorksheetFunction.Search("{", stringa) + 1, Len(stringa) - Range("A" & i).Find("}", , , , , xlPrevious))
i = i + 1
Next
End Sub
Thanks!