View Single Post
  #3   Report Post  
MikeM
 
Posts: n/a
Default

Bob:
Thanks so much for your quick reply! I tried it and it works perfectly.

Could it be set up so I could define the worksheet name before running the
macro? (by typing it into a cell or something like that)?

For example, one workbook might need to be USA1, USA2, etc. and another
might need to be CANADA1, CANADA2, etc.

"Bob Phillips" wrote:

Const sBase as string = "USA"
Dim i as long
Dim sh As Object

For Each sh In Activeworkbook.Sheets
i = i + 1
sh.name = sBase & i
Next sh

--

HTH

RP
(remove nothere from the email address if mailing direct)


"MikeM" <michael[dot]mittelmanl[at]db[dot]com wrote in message
...
I would like to take an existing workbook and rename all the worksheet

tabs
at one time. For example, I might have ten worksheets with various names

and
I'd like them all to be named USA1, USA2, USA3 and so on.

Can this be easily done with some VBA code? (I've seen some similar
questions, but none exactly like this one.)

Thanks.