After I apply an autofilter to get to the data I am wanting to work with I need to make Column AA equal to Column X. Is there a way to paste into visible cells of AA or a way to set the cell in AA = X? Being that it is a moving target I am not sure how to declare this range.
Current code: That cannot be used on multiple selections
Dim xlBook As Workbook
Dim xlSheet As Worksheet
Dim LastRow As Long
Dim LastRow2 As Long
Set xlBook = ActiveWorkbook
Set xlSheet = xlBook.Sheets("dspExcelExport")
If xlSheet.AutoFilterMode Then
xlSheet.AutoFilter.ShowAllData
'filter for AM times and update AA to reflect 12
xlSheet.Range("A:AA").AutoFilter Field:=21, Criteria1:="*AM*"
xlSheet.Range("X2:X" & LastRow).SpecialCells(xlCellTypeVisible).Copy _
Destination:=xlSheet.Range("AA2").SpecialCells(xlCellTypeVisible)
Current code: That cannot be used on multiple selections
Dim xlBook As Workbook
Dim xlSheet As Worksheet
Dim LastRow As Long
Dim LastRow2 As Long
Set xlBook = ActiveWorkbook
Set xlSheet = xlBook.Sheets("dspExcelExport")
If xlSheet.AutoFilterMode Then
xlSheet.AutoFilter.ShowAllData
'filter for AM times and update AA to reflect 12
xlSheet.Range("A:AA").AutoFilter Field:=21, Criteria1:="*AM*"
xlSheet.Range("X2:X" & LastRow).SpecialCells(xlCellTypeVisible).Copy _
Destination:=xlSheet.Range("AA2").SpecialCells(xlCellTypeVisible)