I am trying to write a VBA macro to catch if someone is trying to re-pull data.
Basically, my users cannot remember if they have pulled results for the current date into a worksheet.
I need to write a logic statement to compare the current date (sitting in Cell "W2" to the column of dates in column A.
I keep getting an error with the code I have when I run it.
Red text is the fail point.
DThib
Basically, my users cannot remember if they have pulled results for the current date into a worksheet.
I need to write a logic statement to compare the current date (sitting in Cell "W2" to the column of dates in column A.
I keep getting an error with the code I have when I run it.
Code:
Dim WDate As Date
WDate = Sheets("Sheet1").Range("W2").Value
[B][COLOR=#b22222] If Sheets("Sheet1").Column("B") = WDate Then[/COLOR][/B]
[I] run code[/I]
ElseIf Sheets("Sheet1").Range("B") <> WDate Then
MsgBox "Current data already present go to Entry Form", vbInformation + vbOKCancel, "Already Entered"
End If
DThib
Last edited: