Copy formula to next available cell in row

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,604
Office Version
  1. 365
Platform
  1. Windows
Hi all

Does anybody know how I can auto find the last cell populated in column B of my 'cars' sheet, then drag down and copy the formual into the next 7 rows.

for example if cell B65 holds the formula
Code:
=pivot!F649
this will be dragged down to populate B66:B72 where ....
B66 cell will hold formula =pivot!F650
B67 cell will hold formula =pivot!F651
B68 cell will hold formula =pivot!F652...etc etc

I guess the
Code:
With Sheets("cars").Range("B" & Rows.Count).End(xlUp).Copy
will find and copy the formula for me but to then drag it down 7 rows - I have no idea :(

any help much appreciated
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Try

Code:
With Sheets("cars")
    .Range("B" & Rows.Count).End(xlUp).AutoFill Destination:=.Range("B" & Rows.Count).End(xlUp).Resize(8)
End With
 
Upvote 0
..sorry just to add another question

If I wanted to expand the range so that after finding first availabe row in Column B the formula in BOTH columns B and E are dragged down 7 rows..

I though it might be

.Range("B:E" & Rows.Count).End(xlUp).AutoFill Destination:=.Range("B:E" & Rows.Count).End(xlUp).Resize(8)
End With

but it doesn't work
thanks again
 
Upvote 0
Try

Code:
With Sheets("cars")
    LR = .Range("B" & Rows.Count).End(xlUp).Row
    .Range("B" & LR).AutoFill Destination:=.Range("B" & LR).Resize(8)
    .Range("E" & LR).AutoFill Destination:=.Range("E" & LR).Resize(8)
End With
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,270
Members
452,902
Latest member
Knuddeluff

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