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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,990
Messages
5,834,751
Members
430,315
Latest member
bobh63

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
Top