Hello,
I am new to VBA (and the learning process is going slow becuase of work hours) but I need help putting together a loop to go through a named range. My code is as follows:
I am getting an error on the If statement (1004 run time error). Maybe i am going about this the wrong way, but my method behind this is if the range (lrow,2) value is not blank then do the forumula. Any help would be appreciated.
Thanks.
I am new to VBA (and the learning process is going slow becuase of work hours) but I need help putting together a loop to go through a named range. My code is as follows:
Code:
Sub test()
Dim intlastrow As Integer
Dim CN As String
Dim lrow As Integer
intlastrow = Cells(Rows.Count, 2).End(xlUp).Row
MsgBox intlastrow
For lrow = intlastrow To 2 Step -1
With Range("WBS").Select
If Not Range(lrow, 2).Value = "" Then
Range(lrow, 1).Value = MID(Trim(Cells(lrow, 2)), 9, 12)
End If
End With
Next lrow
End Sub
Thanks.