george hart
Board Regular
- Joined
- Dec 4, 2008
- Messages
- 241
The code below works fine if I have an actual date in column AJ. However, should column AJ contain anything other than a date - for example text it falls over.
In short i need to amend the code so that If any cells in column column AJ <> date do nothing, else carry on.
The "On Error Resume Next" doesn't appear to work??
Any ideas most appreciated and thanks in advance...
In short i need to amend the code so that If any cells in column column AJ <> date do nothing, else carry on.
The "On Error Resume Next" doesn't appear to work??
Code:
On Error Resume Next
For x = 5 To Cells(Rows.Count, "A").End(xlUp).Row
Dim a As Date, b As Date
a = Worksheets("Gateline Database").Range("AJ" & x)
b = Date
If Worksheets("Gateline Database").Range("AN" & x) = "" _
And Worksheets("Gateline Database").Range("AJ" & x) <> "" _
And a - b <= 28 Then
Do something....I have left this code out...
Any ideas most appreciated and thanks in advance...