Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code:
Elseif Activeworkbook.sheets.names = "Sheet 1" Then Sheets("Sheet 1").Delete Basically, I have Workbook A and Workbook B. In Workbook A, I created a user form with various functionalities, and the code above is part of the user form. When I open Workbook A in the same instance as Workbook B, the user form will open on the Workbook B. When I click on any button on the user form, the code will execute on Workbook B. The purpose of the code above is to check whether "Sheet 1" exists in Workbook B. If exist, delete "Sheet 1". I am having problem with the code (Elseif Activeworkbook.Sheets.Names = "Sheet 1" Then) to check whether "Sheet 1" exists. Can someone help me with the code? Below is the structure of my entire code: Private Sub cmdTest_Click() If ....... Then ....... Elseif Activeworkbook.Sheets.Names = "Sheet 1" Then Sheets("Sheet 1").Delete Else ........ End If End Sub Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
Excel code convert to Access code - Concat & eliminate duplicates | Excel Programming | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming |