PC Review


Reply
Thread Tools Rate Thread

Code to Copy a Formula to Multiple Sheets Q

 
 
Seanie
Guest
Posts: n/a
 
      5th Nov 2008
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
 
Reply With Quote
 
 
 
 
Mike Fogleman
Guest
Posts: n/a
 
      5th Nov 2008
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
"Seanie" <(E-Mail Removed)> wrote in message
news:b48ed03d-ddf9-4bb8-86ba-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Seanie
Guest
Posts: n/a
 
      5th Nov 2008
Mike, thats fantastic

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy formula from various sheets Roger Dodger Microsoft Excel Misc 2 22nd Sep 2010 01:46 AM
copy sheets for formula afdmello Microsoft Excel Discussion 1 14th Oct 2009 03:40 PM
Copy date formula to multiple sheets =?Utf-8?B?Sm9obg==?= Microsoft Excel Misc 2 22nd Nov 2006 10:36 PM
Copy relative formula across sheets mmwilcox Microsoft Excel Misc 5 7th May 2004 12:40 AM
Copy sheets without the vb code kevin carter Microsoft Excel Misc 2 4th Feb 2004 01:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:18 PM.