Moving data from one cell to another

Iggy 2

New Member
Joined
Jun 28, 2016
Messages
32
Hi,

I am trying to create a macro that will select data cut it and paste it one cell up and one cell to the right.

To select the data i am using a filter, i do not know if there is a better way please help

here is what i have so far
ActiveSheet.Range("$A$2:$W$200").AutoFilter Field:=7, Criteria1:="Total:" Range("G2:G300").Select
Selection.SpecialCells(xlCellTypeVisible).Select
ActiveSheet.Range("$A$2:$W$200").AutoFilter Field:=7
Selection.Cut Destination:=Range.Offset(-1, 1)

The offset gives me the error compile error argument not optional

Thanks in advance.

Juan
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Is there a way to set my range starting point as my selection before i offset?
Code:
ActiveSheet.Range("$A$2:$W$200").AutoFilter Field:=7, Criteria1:="Total:"
    Range("G2:G300").Select
    Selection.SpecialCells(xlCellTypeVisible).Select
    ActiveSheet.Range("$A$2:$W$200").AutoFilter Field:=7
    Selection.Cut Destination:=Range(Selection).Offset(-1, 1)
 
Upvote 0
Ok i got a bit further

Code:
Selection.Cut Destination:=ActiveCell.Offset(-1, 1)

Is giving me the error "this cant be done on a multiple range selection" Is there a way to circumvent that other than writing the code for one cell at a time?
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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