Could someone tell me why my macro isnt running correctly? The macro is suppose start runnning 4 rows down after it finds the cell with the word "components" but I think its trying to run on the row directly after the row that contains the cell with the word components?
Public Sub ZS1LOSTL_TREE_breakDown2()
Dim i As Long, j As Long, Rw As Long
Dim offset As Object
Application.ScreenUpdating = False
With ActiveSheet
Rw = .Cells.Find("Components", LookIn:=xlValues, LookAt:=xlWhole).Row + 1
For i = Rw To .Cells(Rows.Count, 1).End(xlUp).Row
'offset = .Cells(i, 1)
If .Cells(i, 1) <> "" Then
For j = Cells(i, 1).Value To .UsedRange.Columns.Count
If .Cells(i, j + 1) <> "" Then
.Cells(i, 2) = .Cells(i, j + 1)
Exit For
End If
Next j
End If
' .Cells(i, 2).Value = .Cells(i, 2 + offset)
Next i
End With
Application.ScreenUpdating = True
End Sub
Bookmarks