Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default reference to another sheet not in wkbk brings up dialog box

I have a macro that writes a formula referencing another sheet in the
workbook. When this sheet isn't in the workbook, Excel opens the dialog box
to find the sheet and repeats for every line that contains the reference. I
would like to add something around the section referring to another sheet to
bypass that section if the sheet is not in the workbook. Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default reference to another sheet not in wkbk brings up dialog box

Valeire

Dim ShtName As String
'Other Code

On Error Goto NoSheet:
ShtName = Worksheets("Sheet that may not be there").Name
'Code for formula referencing
NoSheet:

'Finish up code

HTH,
Bernie
MS Excel MVP


"Valerie" wrote in message
...
I have a macro that writes a formula referencing another sheet in the
workbook. When this sheet isn't in the workbook, Excel opens the dialog box
to find the sheet and repeats for every line that contains the reference. I
would like to add something around the section referring to another sheet to
bypass that section if the sheet is not in the workbook. Is this possible?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default reference to another sheet not in wkbk brings up dialog box

Perfect!! Thanks so much!

"Bernie Deitrick" wrote:

Valeire

Dim ShtName As String
'Other Code

On Error Goto NoSheet:
ShtName = Worksheets("Sheet that may not be there").Name
'Code for formula referencing
NoSheet:

'Finish up code

HTH,
Bernie
MS Excel MVP


"Valerie" wrote in message
...
I have a macro that writes a formula referencing another sheet in the
workbook. When this sheet isn't in the workbook, Excel opens the dialog box
to find the sheet and repeats for every line that contains the reference. I
would like to add something around the section referring to another sheet to
bypass that section if the sheet is not in the workbook. Is this possible?




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
Creating a Hyperlink from 1 WKBK to open another WKBK and activate Barb Reinhardt Excel Programming 10 May 31st 07 06:45 PM
Large wkbk won't recalc after moving sheet Cody Dawg Excel Discussion (Misc queries) 2 October 17th 06 05:36 PM
How can I look for a sheet in a wkbk and run a macro if not there jkt Excel Programming 3 July 12th 06 10:09 PM
How do I replicate an area of a SS onto another sheet in same wkbk Dave Excel Discussion (Misc queries) 2 June 23rd 06 06:55 PM
print prevu button brings rights management dialog box - how do i troubled terry Setting up and Configuration of Excel 0 January 3rd 06 11:45 PM


All times are GMT +1. The time now is 01:16 AM.

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"