Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Numbering sheets

hi
i have managed to name all of the sheets the same
automaticly but when i save i need all of the sheets to
automaticly increase by one.
i.e. if all the sheets were called 20 when i save i need
them to become 21

thanks

NICK
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Numbering sheets

Nick,

When you say that you have named all the sheets the same,
I presume you mean just the last two characters, so you
have:
RandomText_20
OtherRandomText_20
EvenMoreRandomText_20 etc

....and you want to up suffix to
RandomText_21
OtherRandomText_21
EvenMoreRandomText_21 etc

Is this about right? It easy to do with some code in the
BeforeSave event. Confirm what you need and I'll get back
to you...

Cheers,
Dave.
-----Original Message-----
hi
i have managed to name all of the sheets the same
automaticly but when i save i need all of the sheets to
automaticly increase by one.
i.e. if all the sheets were called 20 when i save i need
them to become 21

thanks

NICK
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Numbering sheets

All of the sheets in excel are at the moment all numbered the same using
code.
when i go to save i need the sheet numbers to increase by one each time.

could someone please tell me how i would do this?
would i use VB for aplications???

thanks

NICK



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Numbering sheets

I made some sheets that used numbers (1,2,3,4,...). No additional characters in
the names.

Then this worked ok for me:

Option Explicit
Sub testme2()

Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
wks.Name = "XXXX_" & wks.Name
Next wks
For Each wks In ActiveWorkbook.Worksheets
wks.Name = Mid(wks.Name, 6, 255) + 1
Next wks

End Sub

If your names are consistently named, maybe you can use this idea. I prefixed
the names with XXXX_ to make them unique. If your names are already 31
characters long, then this idea won't work.

Nick Gilkes wrote:

All of the sheets in excel are at the moment all numbered the same using
code.
when i go to save i need the sheet numbers to increase by one each time.

could someone please tell me how i would do this?
would i use VB for aplications???

thanks

NICK

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

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
Numbering Sheets albertmb Excel Discussion (Misc queries) 3 November 21st 07 01:11 AM
Page numbering of multiple sheets JHJ Excel Discussion (Misc queries) 1 May 30th 07 04:19 AM
Numbering Multiple Sheets derek Excel Discussion (Misc queries) 3 May 4th 06 02:48 AM
Numbering sheets in workbook Red Excel Worksheet Functions 3 March 2nd 05 08:10 PM
numbering new sheets with the same number NICK Excel Programming 2 September 5th 03 11:33 AM


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