Hi.
I need to compare a cell with a value in my function but i'm having Object required error.
If i put the only the "IF" code inside the worksheet_change everything works fine.
But i need a function.
Can anyone help me?
Thank you
Here is the example
I need to compare a cell with a value in my function but i'm having Object required error.
If i put the only the "IF" code inside the worksheet_change everything works fine.
But i need a function.
Can anyone help me?
Thank you
Here is the example
VBA Code:
Sub PrintSheet()
If Target.Address = "$F$2" Then
If (Target.Value = "Work") Or (Target.Value = "Home") Then
With Worksheets("sheet1").PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
End With
Else
End If
End If