Forum Discussion
urbansito
Jan 23, 2023Copper Contributor
VBA - Need Help Please - not all rows are copied
Hi Guys, Need your help, please. I have this VBA code below and it's basically a dynamic filter that copies the filtered data into a new sheet. However, the last 3 rows from my data are not copie...
urbansito
Jan 23, 2023Copper Contributor
my Cell A1 to A4 is blank data since I'm having my data starts at A5
mtarler
Jan 23, 2023Silver Contributor
BTW, it appears that everything before:
ThisWorkbook.Sheets("CustomerAmt").Cells.clearcontents
is acting on "Sheet4" and has no affect on the copy/paste
and then after that you have:
ActiveSheet.Range("A5").AutoFilter field:=7, Criteria1:=xlFilterLastMonth, Operator:=xlFilterDynamic
orig.Range(Cells(5, 1), Cells(count_row, count_col)).SpecialCells(xlCellTypeVisible).Copy
which will filter for LAST month and then only copy visible so is it that the last 3 rows are THIS month?
ThisWorkbook.Sheets("CustomerAmt").Cells.clearcontents
is acting on "Sheet4" and has no affect on the copy/paste
and then after that you have:
ActiveSheet.Range("A5").AutoFilter field:=7, Criteria1:=xlFilterLastMonth, Operator:=xlFilterDynamic
orig.Range(Cells(5, 1), Cells(count_row, count_col)).SpecialCells(xlCellTypeVisible).Copy
which will filter for LAST month and then only copy visible so is it that the last 3 rows are THIS month?