Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
drvortex
 
Posts: n/a
Default Worksheet Reference


All,

I'm really stumped here. Need to find out the function (IF) on
checking to see if a particular "Worksheet" exists. I have a macro
setup to automatically CREATE new worksheets in the same workbook;
however, I have another sheet that is referencing data on the new
worksheets on the final worksheet. Any suggestions?? This is urgent
and any info would be a great help.

JP


--
drvortex
------------------------------------------------------------------------
drvortex's Profile: http://www.excelforum.com/member.php...o&userid=15896
View this thread: http://www.excelforum.com/showthread...hreadid=273865

  #2   Report Post  
LanceB
 
Posts: n/a
Default

I don't believe you can do it as a worksheet function. You can however walk
thru the sheets collection to find a sheet name. The code listed below walks
thru each worksheet and checks the name against "Sheet2". If it exists it
places the sheet name in cell a1 of the active sheet.

Sub findit()
Dim ws As Worksheet

For Each ws In Sheets
If ws.Name = "Sheet2" Then
[a1] = ws.Name
End If
Next

End Sub


"drvortex" wrote:


All,

I'm really stumped here. Need to find out the function (IF) on
checking to see if a particular "Worksheet" exists. I have a macro
setup to automatically CREATE new worksheets in the same workbook;
however, I have another sheet that is referencing data on the new
worksheets on the final worksheet. Any suggestions?? This is urgent
and any info would be a great help.

JP


--
drvortex
------------------------------------------------------------------------
drvortex's Profile: http://www.excelforum.com/member.php...o&userid=15896
View this thread: http://www.excelforum.com/showthread...hreadid=273865


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
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM
Executing macro for all worksheet from a different worksheet Biti New Users to Excel 3 December 8th 04 10:05 AM
Reference Data in Moved Worksheet tommcbrny Setting up and Configuration of Excel 1 December 1st 04 06:49 PM
Worksheet name and Backward compatibility Rich Excel Discussion (Misc queries) 3 November 30th 04 06:10 PM


All times are GMT +1. The time now is 06:28 PM.

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

About Us

"It's about Microsoft Excel"