Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet number OutOfRange
Hi!
I create a new workbook (VBScript in Excel 2003) and automatically 3 sheets are created (Sheet1, Sheet2, Sheet3). As I run thru the input file, if there's a new client, I want to use a new Sheet. Sheet 1 is successfully renamed to clientName (see code below), but when I want to use the next one, Sheet2, I get an OutOfRange error. worksheet = 1 Set objWorksheet = objWorkbook.Worksheets(worksheet) objWorksheet.Name = clientName lastClientName = clientName If (clientName < lastClientName) worksheet = worksheet + 1 Set objWorksheet = objWorkbook.Worksheets(worksheet) objWorksheet.Name = clientName End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find a number on another worksheet | Excel Worksheet Functions | |||
Finding the number of a worksheet | Excel Discussion (Misc queries) | |||
Enter number on a worksheet to copy row from another worksheet | Excel Worksheet Functions | |||
Basic Question - How do I return the worksheet number of the active worksheet? | Excel Programming | |||
Automatically number a worksheet | Excel Discussion (Misc queries) |