Hi, I have 2 sheets with data downloaded. I have cross-referenced them and have "yes" and "no" results in Column A in each sheet. I am trying to copy rows with "yes" in column A. I need them to be separate macros because I will have another macro to tidy up the data from "DSS download" table before bringing in the second set of data. The first macro is working, the second macro is working but I need it to put the data at the end of the existing data in "Results"
Code:
Option Explicit
Sub UpdateDSSEntries()
Dim wsA As Worksheet: Set wsA = Sheets("Results")
Dim wsD As Worksheet: Set wsD = Sheets("DSS download")
'clear the Results
wsA.UsedRange.ClearContents
'Use the autofilter to grab all audit entries from data sheet
With wsD
.AutoFilterMode = False
.Range("A:A").AutoFilter
.Range("A:A").AutoFilter Field:=1, Criteria1:="yes"
.UsedRange.SpecialCells(xlCellTypeVisible).Copy wsA.Range("A1")
.AutoFilterMode = False
End With
End Sub
Sub UpdateMEWSEntries()
Dim wsA As Worksheet: Set wsA = Sheets("Results")
Dim wsD As Worksheet: Set wsD = Sheets("MS EWS download")
'go to the end of Results
wsA.UsedRange.SpecialCells (xlCellTypeLastCell)
'Use the autofilter to grab all audit entries from data sheet
With wsD
.AutoFilterMode = False
.Range("A:A").AutoFilter
.Range("A:A").AutoFilter Field:=1, Criteria1:="yes"
.UsedRange.SpecialCells(xlCellTypeVisible).Copy wsA.Range("A1")
.AutoFilterMode = False
End With
End Sub