LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Incorporating error handling to Bob's code

Hi Bob,

I've incorporated your code successfully, but names are being continuously
added to my list (C12 to C412) from which my worksheet names are being
generated. I'd like to add an error handling event to your code so that the
user can add names once they've run the macro. For example: After running the
macro to add 195 names (known at present), I need to add an error handling
procedure to have VB loop through names until it comes across a newly added
name(s) (known in future) at which point it will create a new worksheet with
the corresponding name(s) in my "C12:C412" range using the template in
"Master" without generating an error message. To add to this problem, I would
like to add hyperlinks to each of my cells (C12 to C412) so that the user can
quickly go to a requested worksheet.

Here is the code that I have thus far:

Private Sub CommandButton1_Click()
Dim LastCell As Range, Rng As Range, cell As Range
Dim WS As Worksheet
Set WS = ActiveSheet
Set LastCell = WS.Cells(Rows.Count, "C").End(xlUp)
Set Rng = WS.Range("C12", LastCell)
For Each cell In Rng
If Not IsEmpty(cell) Then
Sheets("Master").Copy after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = cell.Value
End If
Next
End Sub

Your or someone else's assistance would be greatly appreciated! - TIA
--
Kent Lysell
Financial Consultant
Ottawa, Ontario
H: (613) 907-1211
W: (613) 943-9098

 
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
UDF Error Handling is ignored. Not for everyone? [email protected] Excel Programming 4 March 22nd 06 06:31 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Error handling in this code L. Howard Kittle Excel Discussion (Misc queries) 4 October 8th 05 12:35 PM
VB handling on mdi print error code 1004 Walter L. skinner Excel Programming 1 October 5th 05 03:30 PM
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM


All times are GMT +1. The time now is 07:50 AM.

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

About Us

"It's about Microsoft Excel"