View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default With statement question

On Sat, 15 Nov 2008 11:28:43 -0800, "Patrick C. Simonds"
wrote:

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