sspatriots
Well-known Member
- Joined
- Nov 22, 2011
- Messages
- 585
- Office Version
- 365
- Platform
- Windows
I'm trying to use "Today()" in my conditional formatting on my UserForm, however, I get the error message "Compile error: Sub or Function not defined". If I use "Today()" in my code that sets the formatting on the worksheet table itself, how come my code for my UserForm won't accept it?
Thanks, SS
VBA Code:
'Cab
If tb.ListColumns("Job" & Chr(10) & "Status").DataBodyRange.Cells(i).Value <> "3 CJN" _
And tb.ListColumns("Job" & Chr(10) & "Status").DataBodyRange.Cells(i).Value <> "5 CJS" _
And tb.ListColumns("Job" & Chr(10) & "Status").DataBodyRange.Cells(i).Value <> "6 DOJ" _
And tb.ListColumns("Job" & Chr(10) & "Status").DataBodyRange.Cells(i).Value <> "7 CXL" _
And tb.ListColumns("Cab" & Chr(10) & "REQD Date").DataBodyRange.Cells(i).Value < Today() _
And tb.ListColumns("Cab" & Chr(10) & "REQD Date").DataBodyRange.Cells(i).Value <> "" Then
Job_Status_PM.txtJobName.BackColor = RGB(255, 199, 206) 'Light Red
Job_Status_PM.txtJobName.ForeColor = RGB(156, 0, 6) 'Burgundy
'CF for "Customer Details" Tab
Job_Status_PM.txtJobName2.BackColor = RGB(255, 199, 206) 'Light Red
Job_Status_PM.txtJobName2.ForeColor = RGB(156, 0, 6) 'Burgundy
Thanks, SS