I have a list that I'd like to filter on Field 3 and copy the visible cells starting in A2 to column G then paste into Sheet2 A2. Then copy visible cells from J2 to M and paste into Sheet2 H2. Previously I was using this code for just the first part but I'm having trouble modifying it to handle copy/paste of the second section (J2-M). Any suggestions?
Code:
Sub Filter_NWSheet()
Dim wbBook As Workbook
Dim wsSheet As Worksheet
Dim rnStart As Range, rnData As Range
Set wbBook = ThisWorkbook
Set wsSheet = wbBook.Worksheets("Sheet1")
With wsSheet
Set rnStart = .Range("A1")
Set rnData = .Range(.Range("A2"), .Cells(.Rows.Count, 7).End(xlUp))
End With
Application.ScreenUpdating = True
rnStart.AutoFilter Field:=3, Criteria1:="x"
rnData.SpecialCells(xlCellTypeVisible).Copy
Sheets("Sheet2").Range("A2").PasteSpecial xlPasteValues
rnStart.AutoFilter Field:=3
With Application
.CutCopyMode = False
.ScreenUpdating = False
End With
End Sub