when I run this it keeps on showing (runtime error 424 object required). please help me correct this.
Sub Nextmonth()
If ActiveSheet.Range(“A3”).Value = 12 Then
Exit Sub
Else:
Range(“A3”).Value = Range(“A3”).Value + 1
DLANDINV.Columns(“B:NK”).Hidden = True
DLANDINV.Range(Columns(Range(“A3”).Value * 31 – 29), Columns(Range(“A3”).Value * 31 + 1)).Hidden = False
End If
End Sub
Sub previousMonth()
If ActiveSheet.Range(“A3”).Value = 1 Then
Exit Sub
Else:
Range(“A3”).Value = Range(“A3”).Value – 1
DLANDINV.Columns(“B:NK”).Hidden = True
DLANDINV.Range(Columns(Range(“A3”).Value * 31 – 29), Columns(Range(“A3”).Value * 31 + 1)).Hidden = False
End If
End Sub
I tried changing the name of the sheet but I can’t find the error yet. am expecting that my problem will be solved. and even correction on the code so that i can be able to run it.
Selina Nasimiyu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.