Cut and Paste Data in a Filitered Range

lifesgood

New Member
Joined
Feb 22, 2018
Messages
5
Hi,

I'm pretty new to VBA and I would like to cut the data available below the header column from columns L to S and paste it in Columns D to K in the same sheet. Please note that it is a filtered range and the data should be cut from and pasted in the visible cells only. Also, please note that the header column should not be included. Please let me know if you need more details. :)

Thanks in advance for all your help! :)
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I did try to come up with something but the paste function doesn't seem to be working. It selects the cell below the header in Column D but the data doesn't get pasted :( Also, the filtered range seems to be very specific to the current data I have in my sheet. I'm not sure how to change this part of the code - " ActiveSheet.Range("$A$1:$U$105").AutoFilter Field:=19, Criteria1:="<>" " and make it non-specific.

Range("S1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$U$105").AutoFilter Field:=19, Criteria1:="<>"
Range("L1:S1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1, Selection.Columns.Count).Cut
With Worksheets("Sheet1").AutoFilter.Range
Range("D" & .Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Row).Select
End With
Selection.Paste
 
Upvote 0

Forum statistics

Threads
1,216,040
Messages
6,128,454
Members
449,455
Latest member
jesski

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