Aug 01 2022 04:29 PM - edited Dec 04 2022 08:11 AM
Hello. I am trying to test the current or todays date's month and day.
If it matches Dec 31 or Jan 1 or Jan 2, perform EOY or new year processing.
If 12/31 or 1/01 or 1/02 I would like to set the page number to "1" else add 1 to the page number. My page number is located in cell L1 on my excel sheet.
Thank you to all who can help me.
Here is what I have tried to code:
' Comment: Page number is located in cell L1
If (Month(TODAY()) = 12 And Day(TODAY()) = 31) Or _
(Month(TODAY()) = 01 And Day(TODAY()) = 01) Or _
(Month(TODAY()) = 01 And Day(TODAY()) = 02) Then
Range("L1").Value = 01
ElseIf Range("L1").Value > 0 Then
Range("L1").Value = Range("L1").Value + 01
Else
Range("L1").Value = 01
End If
Aug 01 2022 05:12 PM - edited Aug 01 2022 05:15 PM
Solution
Range("O" & Cmbcellrow).Value = Range("O" & Intcellrow).Value
or
Cells(Cmbcellrow, "o").Value = Cells(Intcellrow, "o").Value
Aug 01 2022 05:17 PM
Sorry, overlooked the second example. Try:
WorksheetFunction.CountIf(Pg1range, Cells(Intcellrow, "o"))
Aug 01 2022 05:12 PM - edited Aug 01 2022 05:15 PM
Solution
Range("O" & Cmbcellrow).Value = Range("O" & Intcellrow).Value
or
Cells(Cmbcellrow, "o").Value = Cells(Intcellrow, "o").Value