Copy Unknown range After autofilter

mattd4385

New Member
Joined
Nov 15, 2010
Messages
42
I want to copy and Unknown range After autofilter.

the data is only in col A:F
row A is a header that was used to filter but I Do Not want to copy it.
 
Matt does this mean you have a working solution then?

Take a look at this sample

Sub cpy()
Dim LR As Long, i As Long
With Sheets("Sheet1")
LR = .Range("F" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If .Range("K" & i).Value <> "" Then .Rows(i).Copy Destination:=Sheets("Next Sheet Name").Range("A" & Rows.Count).End(xlUp).Offset(1)
Next i
End With
End Sub
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
For anyone who need the code I Got it to work.

With ActiveSheet
.AutoFilterMode = False
'Filter data by BFN-500
With Range("F1", Range("F" & Rows.Count).End(xlUp))
.AutoFilter 1, "*BFN-500*"
On Error Resume Next
'Select the data tp be Copied
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:E" & lastrow).SpecialCells(xlCellTypeVisible).Copy

Sheets("BFN-500").Select
'find empty the next cell in cal A and paste data
Set FirstBlankCell = Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
FirstBlankCell.Activate
'paste data
ActiveSheet.Paste
End With

.AutoFilterMode = False
End With
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,753
Members
452,940
Latest member
rootytrip

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