Adding Increments across sheets

C

CoachMarty

is it possible to add an increment of 1 across multiple sheets, fo
example, in cell B2 in sheets:1-10 i want to progressively add 1 to th
cell so that sheet10:B2 would be 10, Sheet9:B2 would be 9, etc
 
D

Dave Peterson

As a macro???

Option Explicit
Sub testme()
Dim StartVal As Variant
Dim iCtr As Long

With ActiveWorkbook
StartVal = .Worksheets("sheet1").Range("b2").Value
If IsNumeric(StartVal) = False Then
MsgBox "Please put starting value in B2 of Sheet1"
Exit Sub
End If

For iCtr = 2 To 10
.Worksheets("sheet" & iCtr).Range("B2").Value _
= StartVal + (iCtr - 1)
Next iCtr

End With

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top