Code to Copy a Formula to Multiple Sheets Q

  • Thread starter Thread starter Seanie
  • Start date Start date
S

Seanie

What code could I use to copy a particular formula & format from one
cell to the same cell in all sheets between 2 specific ones? This
would allow a short-cut for me inside of copying it manually 52 times

My Formula which I want to use is in sheet 02-11-08 - Cell L36
The 2 sheets between which I want to copy the above formual is "Start"
& "End" - thus every sheet between these should have the formula and
not these two

Thanks
 
This will use the Clipboard so it need only copy once and then loop\paste
through the sheets.

Sub CopyStart2End()
Dim i As Integer, sNDX As Integer, eNDX As Integer

sNDX = Worksheets("Start").Index + 1 'after Start
eNDX = Worksheets("End").Index - 1 'before End
'if there are always 52 sheets between Start & End
'then use the next 4 lines to check that there are
' If eNDX - sNDX <> 51 Then
' MsgBox ("A sheet is missing")
' Exit Sub
' End If
Worksheets("02-11-08").Range("L36").Copy
For i = sNDX To eNDX
With Worksheets(i)
.Activate
.Paste .Range("L36")
End With
Next
Application.CutCopyMode = False
End Sub


Mike F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top