Substract the header from the selection

Ossian13

New Member
Joined
Oct 21, 2016
Messages
46
Hello guys,

as the title says, how is it possible to substract the header from my selection?
A brief intro in what i want to do:I have a list of data and i have a column with the Status (closed,pending,approved , etc). I have filtered all rows which have the status closed and i want to copy only the visible cells to another sheet. All safe and sound, after i copy the selection i want to remove the rows with the status ,,closed,, but i want the header to remain there.

Code:
ActiveSheet.Range("$L$1:$L$8000").AutoFilter Field:=1, Criteria1:= _
    "=*Closed*", Operator:=xlAnd
    Cells.Select
    Selection.SpecialCells(xlCellTypeVisible).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Worksheets("Closed").Activate
    Range("A1").Select
    ActiveSheet.Paste
    Selection.ColumnWidth = 13.33
this code copies all the rows with the status selected and copies them on the sheet with the name ,,Closed,,
Going back to my source sheet, i want to remove those with the status closed but without the header. Any suggestions?

Regards,
Ossian.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
How about
Code:
ActiveSheet.Range("$L$1:$L$8000").AutoFilter Field:=1, Criteria1:= _
    "=*Closed*", Operator:=xlAnd
    Cells.Select
    Selection.SpecialCells(xlCellTypeVisible).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy Worksheets("Closed").Range("A1")
    Selection.Offset(1).Delete
    Selection.ColumnWidth = 13.33
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,857
Members
449,051
Latest member
excelquestion515

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