Hello lovely helpful people.
I'm not very good at VB in Excel, as I have forgotten how to use it over the years.
I'm writing a macro which will look at a column, and if the column is blank it will insert today's date.
That much is easy and I can do. However, the field is a date field, and thusly if it gets a return of null is shows up as "00/01/1900", and as such my macro misses it. I have tried to work out how to reference a date within the statement, but am drawing a blank, and the help function is beyond useless.
So, I have something along these lines:
Code:
Sub FixTargetDate07()
Dim a As Integer
a = 2
Do
If Cells(a, 6) = "00/01/1900" Then
Cells(a, 6) = Date
a = a + 1
Else
a = a + 1
End If
Loop Until a = 5000
End Sub
I've tried adding a ".Value" to the Cells command at the start, removing the quote marks, etc etc etc.
This is bound to be soemthing simple. Can someone just give me the answer please?