T
tourpro
i need a little more detail on how to do this...
1. what is a general module in your workbook?
2. Copy/paste this Function into a single cell or?
3. Select second sheet then SHIFT + Click on last sheet to group these
sheets. not sure what this means or excatly how to do this...
Assuming L7 on each sheet is where you want the incremented number..........
Copy/paste this Function to a general module in your workbook.
Function PrevSheet(rg As Range)
Application.Volatile
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function
Enter the number 1 in L7 on first sheet.
Select second sheet then SHIFT + Click on last sheet to group these sheets.
Select L7 on active sheet and enter this formula which will be entered on all
selected sheets.
IF(K10>0,prevsheet(L7) +1,"")
Ungroup the sheets and you're done.
Gord Dibben MS Excel MVP
1. what is a general module in your workbook?
2. Copy/paste this Function into a single cell or?
3. Select second sheet then SHIFT + Click on last sheet to group these
sheets. not sure what this means or excatly how to do this...
Assuming L7 on each sheet is where you want the incremented number..........
Copy/paste this Function to a general module in your workbook.
Function PrevSheet(rg As Range)
Application.Volatile
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function
Enter the number 1 in L7 on first sheet.
Select second sheet then SHIFT + Click on last sheet to group these sheets.
Select L7 on active sheet and enter this formula which will be entered on all
selected sheets.
IF(K10>0,prevsheet(L7) +1,"")
Ungroup the sheets and you're done.
Gord Dibben MS Excel MVP