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 |
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 |
All times are GMT +1. The time now is 03:18 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com