Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good evening all,
In the following macro, I'm attempting to delete 20 worksheets from a workbook that has, say 30 worksheets. When I run it, it deletes several sheets, but then it crashes with a runtime error 9 (subscript out of range). I know that an array has to be DIM'd, but I can't figure out the name of the name of the array to be DIM'd. Is the array going to something like "worksheets(50)"?? I've tried this and it doesn't work. Please help! Thanks, JW Sub test() Application.DisplayAlerts = False For i = 1 To 20 ThisWorkbook.worksheets(i).Delete Next i Application.DisplayAlerts = True End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with a conditional max problem | Excel Discussion (Misc queries) | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming |