JoetheSousChef
Technical User
Intention---This little macro is supposed to run down a column of dates. Where there is a #N/A, it changes the cell to TODAY(). It is supposed to stop when it hits the blank cell at the bottom of the column of dates.
Action---When stepped with F8, the cursor moves directly from "Do Until ActiveCell..." to "End Sub", without moving through the "If" statements in the middle.
Resolution---I'm guessing I haven't formulated the "Do Until..." statement correctly. Suggestions gratefully received.
Code:
Sub Macro3()
Do Until ActiveCell.Value >= " "
'runs down until it hits a blank cell
If ActiveCell.FormulaR1C1 = "#N/A" Then
ActiveCell.FormulaR1C1 = "=TODAY()"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
Loop
End Sub