Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
On Error Issues
I'm having issues capturing an error and using it to direct the code. Here is the code I'm trying to execute: Public Sub sheetCheck() cNodes = ThisWorkbook.Names("Nodes").RefersToRange.Rows.Cou nt For i = 1 To cNodes On Error GoTo NewSheet isThere = True sheetName = sheetBase & i Sheets(sheetName).Visible = False check: If Not isThere Then Sheets("Scoring Sheet 0 (2)").Name = sheetName Next i Exit Sub NewSheet: Scoring_0.Copy after:=Scoring_0 isThere = False GoTo check End Sub Nodes refers to a list of nodes for this system. The sheets are named Scoring x, where x would be replaced by i in the loop. The code will execute perfectly through one error, but if I have more than one non-existent sheet, it fails. Cheers- Chris -- cmk18 ------------------------------------------------------------------------ cmk18's Profile: http://www.excelforum.com/member.php...fo&userid=6047 View this thread: http://www.excelforum.com/showthread...hreadid=386540 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking issues | Excel Discussion (Misc queries) | |||
rounding issues | New Users to Excel | |||
After SP2, excel having issues | Excel Discussion (Misc queries) | |||
need help for several issues | Excel Programming | |||
More date issues | Excel Programming |