Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Through VBA, I enabling the use to add another worksheet and and change it's
name. I'm hoped to use the "On Error" trapping to continue looping asking for valide worksheet name. My problem is that the error is trapped only once. The second time around the error no longer trapped. What's the correct way to use "On Error" to achieve my goal? Here's the code. Thanks - Pat Sub AddWorkSheet() Dim vResponse As Variant Sheet1.Copy After:=Sheets(Sheets.Count) On Error GoTo BadName: BadName: vResponse = Trim(InputBox("New worksheet name? ", , ActiveSheet.Name)) If vResponse < "" Then ActiveSheet.Name = vResponse End If On Error GoTo 0 End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inconsistent error message | Excel Discussion (Misc queries) | |||
Inconsistent error | Excel Programming | |||
OLE action error thru automation | Excel Programming | |||
Action on Error | Excel Programming | |||
Action on error | Excel Programming |