I am using AUTOFILTER to filter data on one Excel worksheet (Input_Wkr_Hrs) and append the data to the bottom of a list (table) on another worksheet (Output) in the same workbook. The problem I have is that when the data gets added to the bottom of the list, it includes the HEADER ROW Names. How do you copy filtered data using AUTOFILTER and not include the HEADER NAMES when appending to the bottom of a list?
The source table on the worksheet (Input_Wkr_Hrs) has three columns (Emp Name, Section, Hours).
I am in the beginning stages of learning Excel VBA; this is my first question on Stackoverflow. Code below
Sub GetWorkerData() ' shImput_Wkr_Hrs name if source data sheet ' shOutout name of destination sheet Dim rg As Range Set rg = shImput_Wkr_Hrs.Range("C15").CurrentRegion ' 'TurnOffFunctionality ' Turn off Screen updating and other stuff
With rg
.AutoFilter field:=3, Criteria1:=">0" ' filter working hrs hours >0
.SpecialCells(xlCellTypeVisible).Copy 'Destination:=shOutput.Range("a1")
'
'.Offset(1).Resize(Selection.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Copy
shOutput.Cells(Rows.Count, 1).End(xlUp).Offset(1).PasteSpecial xlPasteValues
' rg.AutoFilter End With ' shOutput.Activate 'TurnOnFunctionality ' Turn on Screen updating and other stuff End Sub