Past data down to last row - code error

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,298
Office Version
  1. 365
Platform
  1. Windows
I'm trying to copy data from Cell A1 and paste it on another form all the way down to the last row (Paste/repeat the same data in each row)

But it doesn't like my paste range. Thanks for the help

Code:
Sub Fill_CBOM()
'Author: G Heyman 190217

'Fill Additional Data
Application.ScreenUpdating = False
ActiveSheet.AutoFilterMode = False

Dim IMDLstRw As Long

    IMDLstRw = Sheet5.Range("A" & Rows.Count).End(xlUp).Row

'Component Qty
    Sheet1.Range("A1").Copy
    Sheet2.Range("A9:A" & IMDLstRw).Selection
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False

End Sub
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I figured it out. My defined range for last row was wrong. I was referencing a different sheet then where I needed to paste my data.

Thanks
 
Upvote 0

Forum statistics

Threads
1,203,097
Messages
6,053,519
Members
444,669
Latest member
Renarian

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