Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi there, I have an array of sheets, and which ever ones are visible I would like it to be deleted, if not do nothing.. So for eg if Master_D and Master are visible then delete them (curretnly VB is getting stuck cause its trying to delete Master, and it isnt visible... Sheets(Array "Master_D", "Master_A", "Master").Activate ActiveWindow.SelectedSheets.Delete Thanks!!! D *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim myNames as variant
dim iCtr as long mynames = Array("Master_D", "Master_A", "Master") on error resume next 'in case it doesn't exist application.displayalerts = false for ictr = lbound(mynames) to ubound(mynames) sheets(mynames(ictr)).delete next ictr application.displayalerts = true on error goto 0 Darin Kramer wrote: Hi there, I have an array of sheets, and which ever ones are visible I would like it to be deleted, if not do nothing.. So for eg if Master_D and Master are visible then delete them (curretnly VB is getting stuck cause its trying to delete Master, and it isnt visible... Sheets(Array "Master_D", "Master_A", "Master").Activate ActiveWindow.SelectedSheets.Delete Thanks!!! D *** Sent via Developersdex http://www.developersdex.com *** -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check for a shape - then change or delete it if it exists | Excel Programming | |||
Macro in Excel using an Array to Delete File in Directory if it Exists | Excel Programming | |||
If worksheet exists delete | Excel Programming | |||
Sheet name already exists | Excel Discussion (Misc queries) | |||
How can I know if a sheet exists ? | Excel Programming |