A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Macro to rename all worksheets with cell value in each sheet



 
 
Thread Tools Display Modes
  #1  
Old July 11th 03, 09:05 AM posted to microsoft.public.excel.programming
Max
external usenet poster
 
Posts: 9,221
Default Macro to rename all worksheets with cell value in each sheet

Hi guys,

I need help for a macro to loop through all worksheets (identical
structure), copy the contents of B2 and rename the sheet with it, all at one
go. B2 will hold text (different for each sheet). I'm using xl97.

TIA
Max


Ads
  #2  
Old July 11th 03, 10:58 AM posted to microsoft.public.excel.programming
Max
external usenet poster
 
Posts: 9,221
Default Macro to rename all worksheets with cell value in each sheet

Many thanks, Neil!
It runs smoothly.

Neil > wrote in message
...
> Max,
> Try this
>
> Sub RenameWS()
> Dim ws As Worksheet
> For Each ws In ActiveWorkbook.Worksheets
> ws.Activate
> ws.Name = Range("B2").Value
> Next
> End Sub
>
> Neil
>
>
> "Max" > wrote in message
> ...
> > Hi guys,
> >
> > I need help for a macro to loop through all worksheets (identical
> > structure), copy the contents of B2 and rename the sheet with it, all at

> one
> > go. B2 will hold text (different for each sheet). I'm using xl97.
> >
> > TIA
> > Max
> >
> >

>
>



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i create a macro to rename worksheets in excel? Waki Excel Discussion (Misc queries) 6 January 28th 10 04:06 PM
Macro REQ: Automatically copy a template sheet and rename MCSmarties Excel Worksheet Functions 5 October 11th 07 09:18 PM
macro to: Add new sheet, then rename new sheet with todays date Paul Excel Worksheet Functions 3 September 29th 07 03:17 AM
Rename Sheet using Cell Reference RDana Excel Worksheet Functions 4 July 2nd 07 07:54 PM
How do I automatically rename a sheet with the contents of a cell. michaelspearin Excel Discussion (Misc queries) 3 December 3rd 04 09:27 PM


All times are GMT +1. The time now is 07:57 PM.


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