With statement question

P

Patrick C. Simonds

The code below works great if the worksheet "Holidays" is active. I need it
to work when Holidays is not the active worksheet.


With Sheets("Holidays")
If range("L1") = "No Picture" Then
Intentions.Show
End If
End With
 
R

Ron Rosenfeld

The code below works great if the worksheet "Holidays" is active. I need it
to work when Holidays is not the active worksheet.


With Sheets("Holidays")
If range("L1") = "No Picture" Then
Intentions.Show
End If
End With

Bad syntax.

Try:

With Sheets("Holidays")
If .range("L1") = "No Picture" Then
Intentions.Show
End If
End With

Note the "." before Range
--ron
 
Top