ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   formula to consecutively number the same cell in different wokshee (https://www.excelbanter.com/excel-discussion-misc-queries/179201-formula-consecutively-number-same-cell-different-wokshee.html)

Geoff

formula to consecutively number the same cell in different wokshee
 
I have room data sheets set up in excel. Each room is a worksheet. There is a
room number in the D4 cell of each worksheet. The first room is number 100,
the next is 101, next 102, etc. consecutively numbered to the last room.

I need a formula for the D4 cell in each worksheet that will renumber all
the room numbers in all the worksheets if a room (worksheet) is added or
subtracted.

Thanks,
Geoff

Sean Timmons

formula to consecutively number the same cell in different wokshee
 
Thinking this can't be done. The tab entered doesn't automatically reference
itself based on it's location within your spreadsheet.

"Geoff" wrote:

I have room data sheets set up in excel. Each room is a worksheet. There is a
room number in the D4 cell of each worksheet. The first room is number 100,
the next is 101, next 102, etc. consecutively numbered to the last room.

I need a formula for the D4 cell in each worksheet that will renumber all
the room numbers in all the worksheets if a room (worksheet) is added or
subtracted.

Thanks,
Geoff


Gord Dibben

formula to consecutively number the same cell in different wokshee
 
Run this macro every time you add or delete a sheet.

Sub Date_Increment()
Dim mynum As Integer
Dim iCtr As Long
mynum = 100
For iCtr = 1 To Worksheets.Count
With Worksheets(iCtr).Range("D4")
.Value = mynum - 1 + iCtr
.NumberFormat = "General"
End With
Next iCtr
End Sub


Gord Dibben MS Excel MVP

On Fri, 7 Mar 2008 11:58:05 -0800, Geoff
wrote:

I have room data sheets set up in excel. Each room is a worksheet. There is a
room number in the D4 cell of each worksheet. The first room is number 100,
the next is 101, next 102, etc. consecutively numbered to the last room.

I need a formula for the D4 cell in each worksheet that will renumber all
the room numbers in all the worksheets if a room (worksheet) is added or
subtracted.

Thanks,
Geoff




All times are GMT +1. The time now is 03:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com