Hi,
I've got a column with some blanks in it, which I want to run a macro on.
How do I tell it to run on the entire column, all the way to the last value, without stopping on the first blank cell?
Here's my macro.
Public Sub MyMacro()
Dim rngCell As Range
Set ws2 = Workbooks("a.xls").Sheets("Sheet2")
For Each rngCell In ws2.Range(Cells(2, "C"), ws2.Cells(Rows.Count, "C").End(xlUp)).Cells
If rngCell.Offset(, 1).Value = "A" Then
With rngCell
.Value = "AAA"
End With
End If
Next rngCell
End Sub
Bookmarks