Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default With statement question

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default With statement question

add the . before the range
.range("L1")
"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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL statement question gab1972 Excel Discussion (Misc queries) 2 November 19th 09 09:42 PM
If statement question maperalia Excel Programming 2 July 9th 07 04:54 PM
IF statement question [email protected] Excel Worksheet Functions 2 July 24th 06 04:20 PM
If Statement Question redwings04 Excel Worksheet Functions 4 July 4th 05 09:42 PM
IF Statement Question Scott Excel Worksheet Functions 15 June 14th 05 07:56 PM


All times are GMT +1. The time now is 03:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"