Copy / Paste without selecting sheet

LORDMARKS

New Member
Joined
Jun 5, 2014
Messages
39
Code:
Sheets("Sheet1").Range("B23:D37").ClearContents
Sheets("Sheet1").Range("B4:D18").SpecialCells(xlCellTypeVisible).Copy Destination:=Sheets("Sheet1").Range("B23:D37")
Sheets("Sheet1").Range("B23:D37").Value = Sheets("Sheet1").Range("B23:D37").Value

The above code works fine when I only select one filter variable, however when I select from another column I get the same data repeated all the way down the target range?

What I am trying to do is clean up some slow recorded macros, given to me on an old workbook. So I am trying to remove all the copy / paste functions and repeat codes. This seemed to be the most efficient way of moving selected data to another sheet so that I could run reports. If anyone has any idea why this doesnt work or can offer a better solution, that would be great.

cheers all
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

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