teatimecrumpet
Active Member
- Joined
- Jun 23, 2010
- Messages
- 307
Hi,
I'm trying to run the below code but it fails a the highlighted line because of "object required". But that line seems to run alright because it does copy all the visible cells excluding the header.
thanks,
I'm trying to run the below code but it fails a the highlighted line because of "object required". But that line seems to run alright because it does copy all the visible cells excluding the header.
thanks,
Sub fRS()
Dim RNG As Range
Set RNG = ActiveSheet.Range("A1").CurrentRegion
RNG.AutoFilter Field:=6, Criteria1:="Yellow"
RNG.AutoFilter Field:=12, Criteria1:=Array( _
"Mike", _
"John", _
"George", _
"Phyllis", _
"Rebecca", _
"Sarah", _
"Calvin", _
"Dylan", _
"Steve", _
"Marvin"), Operator:=xlFilterValues
'exclude header
Set RNG = RNG.Offset(1, 0).Resize(RNG.Rows.Count - 1)
' Get visible cells
Set RNG = RNG.SpecialCells(xlCellTypeVisible).Copy
'Selection.Copy
Windows("Sawyer.xlsx").Activate
Sheets(1).Activate
Range("A1048576").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste