So basically I am at the final stages of creating an excel spreadsheet that generates the fiscal month based on the date give and will assign different tasks to various groups based on the day. I am almost finished the calendar portion but am having a problem in this section
I get the error listed in the title and I don't understand why. Basically this portion of the code is going to look through the calendar and find the date based on what the current day is, and simply highlight it to mark it as "today" the reference is correct (L2). Meaning that I have a cell with the value of todays date and that cell is ALWAYS correct. So I know that's not the issue. The line I believe the error is occurring on is "Sheets("Master Dial").Range("G4:H4, B6:H6, B8:H8, B10:H10, B12:B12").Find(whatsToday).Select" For this example, please assume that whatsToday = 26
currentFiscalMonth = 6
actualMonth = 6
Code:
'Below is the section for finding the current day and highlighting it
Dim whatsToday As Integer 'day value for today
Dim currentFiscalMonth As Integer 'whether it is fiscal date of current month or next month
Dim actualMonth As Integer 'regardless of fiscal month, this generates actual month
whatsToday = Sheets("Master Dial").Range("L2")
currentFiscalMonth = Sheets("Master Dial").Range("m2")
actualMonth = Sheets("Master Dial").Range("L1")
If actualMonth = currentFiscalMonth Then 'if both fiscal and actual month are the same, highlighted day will be after the 1st
Sheets("Master Dial").Range("G4:H4, B6:H6, B8:H8, B10:H10, B12:B12").Find(whatsToday).Select
ActiveCell.Interior.ColorIndex = 6
Else 'if both fiscal and actual month are the same, highlighted day will be before the 1st
If Sheets("Master Dial").Range("b4") <> 1 Then
Sheets("Master Dial").Range("B4:H4").Find(whatsToday).Select
ActiveCell.Interior.ColorIndex = 6
End If
End If
currentFiscalMonth = 6
actualMonth = 6