#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Sheet Name

I need a macro that will change the names of the sheets in a workbook equal
to a given cell in those sheets
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Sheet Name

BOONER wrote:
I need a macro that will change the names of the sheets in a workbook equal
to a given cell in those sheets



sub userform_initialize()

dim x as long
For x = 1 to activeworkbook.sheets.count
activesheet.name = sheets(x).range("A").value
next x

end sub



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Sheet Name

Thanks this puts me on the right track. However, for some reason it is
naming the first sheet with data pulled from the third.

"Crowbar via OfficeKB.com" wrote:

BOONER wrote:
I need a macro that will change the names of the sheets in a workbook equal
to a given cell in those sheets



sub userform_initialize()

dim x as long
For x = 1 to activeworkbook.sheets.count
activesheet.name = sheets(x).range("A").value
next x

end sub



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Sheet Name

Okay, this works..........Thanks a lot Crowbar

Dim x As Long
For x = 3 To ActiveWorkbook.Sheets.Count
Sheets(x).Activate
ActiveSheet.Name = Sheets(x).Range("I7").Value
Next x

"BOONER" wrote:

Thanks this puts me on the right track. However, for some reason it is
naming the first sheet with data pulled from the third.

"Crowbar via OfficeKB.com" wrote:

BOONER wrote:
I need a macro that will change the names of the sheets in a workbook equal
to a given cell in those sheets



sub userform_initialize()

dim x as long
For x = 1 to activeworkbook.sheets.count
activesheet.name = sheets(x).range("A").value
next x

end sub



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1

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
excel sheet bootom half sheet goes behind top part of sheet rob Excel Worksheet Functions 2 January 17th 09 01:28 AM
Duplicate sheet, autonumber sheet, record data on another sheet des-sa[_2_] Excel Worksheet Functions 0 May 8th 08 06:56 PM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM
Copying cells from on sheet to another sheet (via sheet module) CRayF Excel Programming 6 September 20th 05 08:58 PM
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B Hannes Heckner Excel Programming 1 March 5th 04 09:10 AM


All times are GMT +1. The time now is 02:16 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"