Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,814
Default Numbering Sheets incrementally (as in Invoice numbers)

With the least amount of keystrokes, how can I have a number that is typed in
cell J5 on 32 sheets in a workbook increase AUTOMATICALLY by one.
On the first sheet, I type 1000 in cell J5.
Automatically then I want cell J5 on sheet 2 to say 1001,
and so on up to 1032.

PLEASE GIVE ME EVERY STEP, since I have never entered a macro before,ie, I
don't know exactly where to enter it, how to save it, how to run it, etc.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Numbering Sheets incrementally (as in Invoice numbers)

Steve,

This macro will do what you want. Note that you need to set the name of the
first sheet on line where the '<<<<< is.

'------------------copy start
Option Explicit
Sub doformula32sheets()
Dim i As Integer
Dim sSheet1name As String
sSheet1name = "Sheet1" '<<<<<
For i = 2 To 32 'asumming that the first sheet in where the number is
entered
Worksheets(i).Range("J5").Formula = "='" & sSheet1name & "'!J5+" & i
- 1
Next i
End Sub
'------------------copy end

You copy this code above and paste it in to the macro editor.

Do this as follows:

1. From the menu select Tools|Macro|Visual Basic Editor and this opens the
Visual Basic Editor (VBE) window.
2. Then open the project explorer window in the VBE View|Project Explorer.
3. In that window find the VBAProject with the name of the workbook where
your 32 sheets are and select it with one left click of the mouse and then
right click the mouse and select Insert|Module.
3. This opens the module window and you can paste the code above in there.
4. Close the vbe (File|close and return to microsoft excel)
5. In excel save the file
6. Then run the macro with Tools|Macro|Marcos....
7. A dialog box is displayed and select the macro doformula32sheets by
doubleclicking it or selecting it and clicking run.

It should be done.
--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"STEVE" wrote:

With the least amount of keystrokes, how can I have a number that is typed in
cell J5 on 32 sheets in a workbook increase AUTOMATICALLY by one.
On the first sheet, I type 1000 in cell J5.
Automatically then I want cell J5 on sheet 2 to say 1001,
and so on up to 1032.

PLEASE GIVE ME EVERY STEP, since I have never entered a macro before,ie, I
don't know exactly where to enter it, how to save it, how to run it, etc.

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 in workbook Red Excel Worksheet Functions 3 March 2nd 05 09:10 PM
invoice numbering Mel Excel Worksheet Functions 2 January 3rd 05 10:15 PM
Invoice numbers? Missie Excel Worksheet Functions 1 December 13th 04 08:28 AM
Invoice Numbering Kevin Excel Worksheet Functions 1 November 16th 04 04:59 PM
Invoice Numbering Kevin Mayfield Excel Worksheet Functions 0 November 16th 04 03:49 PM


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