Insert Copied Range into Multiple Rows

norts55

Board Regular
Joined
Jul 27, 2012
Messages
183
Hello,
I want a macro that selects rows containing a formula error in column W:W, then copies a range of cells, then pastes this range to those selected cells.

I have written this macro below using other macros that many of you here have helped me with. I think this is close but the insert portion only works if one row selected.

Is there a way to have this insert portion work for multiple selected rows?

Any help would be greatly appreciated as I have been really struggling with this.


VBA Code:
Sub Macro1()
'
' Macro1 Macro
'

'
Dim CopyRange As Range
Dim myRange As Range
    
Sheets("Bid Sheet").Select
Columns("W:W").Select
Selection.SpecialCells(xlCellTypeFormulas, 16).EntireRow.Select

Set myRange = Selection

Set CopyRange = Range("_0_a_a_Bid_Sheet_Sub_Total")
CopyRange.Copy

myRange.Insert.CopyRange Shift:=xlDown


End Sub
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Let's see if my question makes more sense if I modify it. Looking at what I previously posted, I don't know if I made sense of what I am looking for.....


I need to insert my copied range into multiple locations. It seems the problem is, insert only works when one row is selected. "myRange" could have two rows selected or twenty rows. The insert portion of this macro needs to be in some sort of a loop until it inserts at all the selected rows.

Hope this helps generate some interested. If anyone is still confused, please ask a question and I will try to explain things better.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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