Copy and paste special from Active Cell to end

Cluelessonmacros

New Member
Joined
Mar 25, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I am clueless so any help is very much appreciated
I want to copy and paste multiple formulas from the last active cell
Column A will always have data dropped in
I want to copy formulas from H2 to Y2 from the last active cell in Column H to Y (this is because we remove the formulas on a lot of the data to preserve amendments and the data needs to go to to the end of the data in column A

I was trying autofill but it overwrites all the data already in and we manually amend some of this data later

Found a few things but not sure how to quite make it work (I have basic record and some basic amend knowledge on macros only I am a newbie!)

Any help is appreciated. Thank you
This is what I was thinking not sure how on track I am
Dim LastRow As Long
Sheets("Sheet 1").Select
LastRow = Range("A" & Rows.Count).End(xlUp).Row
ActiveCell.AutoFill Destination:=Range("H2:Y2" & LastRow)
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Would using Range("H2:Y2").AutoFill Destination:=Range("H2:Y" & LastRow), instead of ActiveCell.AutoFill Destination:=Range("H2:Y2" & LastRow) do the job?
If not:
-supposing that your column A extends from A2 to A100
-H2:Y2 are populated by formulas
-now do you want to copy H2:Y2 to H3:Y100?

If "No!" then what is the request?
 
Upvote 0
Try
VBA Code:
Sub Macro1()
Lr = Range("H" & Rows.Count).End(xlUp).Offset(1, 0).Row
    Range("H2:Y2").Copy
    Range("H" & Lr & "Y" & Lr).PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
End Sub
 
Upvote 0
Hi,
A simple instruction:
VBA Code:
Range("H2:Y2").Copy Range("H3:Y" & Range("A" & Rows.Count).End(xlUp).Row)
 
Upvote 0
Hi . Thank you both for your advise and comments and I am sorry I didn't explain myself very well.

I want to maintain the previous data entered into columns H to Y, (formulas have all been removed)

I then want to add in the formulas only from H to Y on the next available blank row

for example data is written in and formulas overwritten in H2 to Y100

I then want to add in the formulas from H2 to Y2 and add them in from H101 up to where my data ends in column A

Sorry does this explain it better?
 
Upvote 0
May be
VBA Code:
Sub CopyFormulas()
Dim rstart As Long
    rstart = Range("H" & Rows.Count).End(xlUp).Row + 1
    Range("H2:Y2").Copy Range("H" & rstsrt & ":Y" & Range("A" & Rows.Count).End(xlUp).Row)
End Sub
 
Upvote 0
Once you have tested the macro, feel free to share your comments
 
Upvote 0
Thank you ever so much James006, so when i try this code i do get an error. Run time error 1004 and method 'range of object _Global failed.
Sorry :(
Forgot to add the debug highlights this section Range("H2:Y2").Copy Range("H" & rstsrt & ":Y" & Range("A" & Rows.Count).End(xlUp).Row)
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,055
Latest member
excelhelp12345

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