Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting sheet2 and sheet3 in a workbook
What is the code to delete sheet2 and sheet3 in a close workbook from a
folder call C:\Budget I do want to keep sheet1 only. Thank you in advance. Regards, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting sheet2 and sheet3 in a workbook
your code will need to open that workbook
dim wb as workbook dim sh as worksheet set wb = workbooks.open("{full name and path}") for each sh in wb.worksheets if ws.name<"Sheet1" then Application.DisplayAlerts = False ws.delete Application.DisplayAlerts = True end if next wb.close TRUE "CAM" wrote: What is the code to delete sheet2 and sheet3 in a close workbook from a folder call C:\Budget I do want to keep sheet1 only. Thank you in advance. Regards, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting sheet2 and sheet3 in a workbook
Thanks Patrick for the tip
Regards "Patrick Molloy" wrote in message ... your code will need to open that workbook dim wb as workbook dim sh as worksheet set wb = workbooks.open("{full name and path}") for each sh in wb.worksheets if ws.name<"Sheet1" then Application.DisplayAlerts = False ws.delete Application.DisplayAlerts = True end if next wb.close TRUE "CAM" wrote: What is the code to delete sheet2 and sheet3 in a close workbook from a folder call C:\Budget I do want to keep sheet1 only. Thank you in advance. Regards, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete Worksheets Named Sheet1, Sheet2, Sheet3, etc. | Excel Programming | |||
Want to change text in a cell on sheet2 if date changed in sheet3. | Excel Programming | |||
A1 in sheet1 =” =SUM('sheet2:sheet3'!A1)” | Excel Programming | |||
consoildate all the worksheet(example sheet1,sheet2 and sheet3 etc | Excel Worksheet Functions | |||
copy data from sheet1 based on criteria in sheet2 to sheet3 | Excel Programming |