Help with offset for pasting formulas

mlibrett

New Member
Joined
Aug 11, 2011
Messages
12
I have a formula in one cell, and I need to write the code so that it copies and pastes this formula into the 8 cells beneath it without specifying the actual cells. I'm assuming some sort of offset code would work but I don't know where to begin or find this.

Thanks!
 
What if I wanted to be able to paste the formula down the amount of rows the data I'm using has, rather than specify the number of cells to paste it down?

I have a data set where the amount of rows will constantly be changing, so I want to be able to make it paste this formula down to the last one without it going down the same amount of cells every time.
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Did you really want to start at the ActiveCell each time then? Or do you want to fill the blanks in a certain column so that it fills down to the last used row no matter what column that last data item is in? Coding is very flexible, but knowing exactly what you have and want to do with it will usually get you the best answer for your needs.
 
Upvote 0
I figured out a way to accomplish what I was trying to do but there is probably an easier way.

Here's what I came up with

Code:
Range("AN10").Select
    ActiveCell.FormulaR1C1 = "=+RC[-31]/R3C5"
    Selection.Copy
    Selection.End(xlToLeft).Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(0, 2).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FormulaR1C1 = "=+RC[-31]/R3C5"
    Application.CutCopyMode = False
    Range("A1").Select
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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