I'm trying to loop and find some components in a long list of code to past to different cell.
For now I got this
Sub przenoszenie()
Dim wb As Workbook
Dim komorka As Range
Dim komorka2 As Range
Set wb = ThisWorkbook
Set komorka = wb.Worksheets("Dane").Range("B2")
Set komorka2 = wb.Worksheets("Dane").Range("J2")
For i = 1 To 10000
If InStr(1, komorka.Value, "width=109") And InStr(1, komorka.Value, "colSpan=8") Then
komorka2.Value = komorka.Value
Else
If InStr(1, komorka.Value, "width=90") Then
komorka2.Value = komorka.Value
Else
If InStr(1, komorka.Value, "width=374") Then
komorka2.Value = komorka.Value
End If
End If
End If
komorka = komorka.Offset(1, 0)
komorka2 = komorka2.Offset(1, 0)
Next i
I know that the parts of strings I'm looking for ARE somewhere in that B column of my Excel.
But I'm getting no results in column J. I know I'm missing something in those If
statements. Just can't figure it out ;/