LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Rename Sheets but.....

It looks like this line is what's causing your problems

For Each Target In Selection

To avoid confusion, I suggest declaring another range variable and construct
your code like this:

Dim c as Range
For Each c In Target.Range
If SheetExists(c.Value) Then
MsgBox "Sheet Name " & c.Value & " already used!",
vbCritical, "Duplicate Sheet Name Error"
Application.EnableEvents = False
Application.Undo
Else
Select Case c.Column
Case 2
Sheet2.Name = c.Value
Case 3
Sheet3.Name = c.Value
 
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
TO RENAME & COLOR THE SHEETS Ashwini Excel Discussion (Misc queries) 1 September 11th 06 01:20 PM
Rename multiple sheets al Excel Programming 3 September 30th 05 01:11 PM
Add Sheets and rename GregR Excel Discussion (Misc queries) 13 February 13th 05 10:56 PM
Rename sheets cottage6 Excel Programming 3 February 3rd 05 11:28 PM
Rename Sheets Kevin R Excel Programming 6 February 3rd 05 06:44 PM


All times are GMT +1. The time now is 10:14 PM.

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"