Reproduce formula in sequence

JamieDuncan

Board Regular
Joined
Aug 23, 2006
Messages
132
I am trying to reproduce formulae over a couple thousand rows, unfortunately there are gaps but the formulae must remain sequential,
this is the basic recorded macro to cut copy the data as it is needed but i would like a macro that can start from any active cell (being the top left cell of the first range) as i have to repeat this procedure over several sheets (first sheet took 4 hours!)
Tried using integers but got myself in a kerfuffle! :oops:
Help me! :cry:

Code:
Sub Macro1()
    Range("A13:M29").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("O21").Select
    Application.CutCopyMode = False
    Range("O21:AA37").Cut Destination:=Range("O50:AA66")
    Range("O50:AA66").Select
    Selection.Copy
    Range("A50").Select
    ActiveSheet.Paste
End Sub
 
Wow, this code is great, got to say thanks again as it is so easy to amend this code to do different tasks,

THREE CHEERS FOR SBENDBUCKEYE
(y) (y) (y)
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Thanks for the kind words! Not to quibble, but I think you want this line instead of what you have:
Code:
If (lngSourceSheetRow - m_SOURCE_SHEET_FIRST_DATAROW + 1) Mod 8 = 0 Then
The reason I say that is because what you have will break if your source data ever starts on a different line. By using the constant it will continue to work if you change the constant later. I'm glad you got it to work!
 
Upvote 0

Forum statistics

Threads
1,214,592
Messages
6,120,433
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top