Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jon jon is offline
external usenet poster
 
Posts: 18
Default on error error

I have an automated system to rename every sheet in a
workbook. This often incurs an error when the name is
duplicated and to get round this i used

on error goto 1000

which sorts it out very satisfactorily. The problem is
that this only works once when the macro is run. I have
tried repeating this line when it comes back out of the
code to ammend the error in the vain hope that it would
re-apply the rule. I can't even find anything in the
help file so any advice would be appreciated.

Tia

Jon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default on error error

after you goto 1000, use a Resume xxxx statement in the 1000 section of your
code which resets the error handler.

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

Signature
"jon" wrote in message
...
I have an automated system to rename every sheet in a
workbook. This often incurs an error when the name is
duplicated and to get round this i used

on error goto 1000

which sorts it out very satisfactorily. The problem is
that this only works once when the macro is run. I have
tried repeating this line when it comes back out of the
code to ammend the error in the vain hope that it would
re-apply the rule. I can't even find anything in the
help file so any advice would be appreciated.

Tia

Jon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default on error error

Try using On Error Resume Next, and check the Err object after the rename to
see if it has worked or not.

You should also disable the error handler at the end, On Error Goto 0

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jon" wrote in message
...
I have an automated system to rename every sheet in a
workbook. This often incurs an error when the name is
duplicated and to get round this i used

on error goto 1000

which sorts it out very satisfactorily. The problem is
that this only works once when the macro is run. I have
tried repeating this line when it comes back out of the
code to ammend the error in the vain hope that it would
re-apply the rule. I can't even find anything in the
help file so any advice would be appreciated.

Tia

Jon



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Error of slope taking into account error of the data points cer144 Excel Worksheet Functions 5 July 7th 08 07:26 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"