Wissamsaliba
New Member
- Joined
- Feb 4, 2022
- Messages
- 6
- Office Version
- 2016
- Platform
- Windows
Hello, I am working on a large data set but recently started receiving smaller quantity of data. I used to use autofill a lot with filtered data but it seems if I have only 1 row of filtered data and use autofill it gives me the old image(I am changing the value inside the cell). Is there a way to write a code that if it counts 1 row to just replace the cells without autofill? below you can find my code that works properly if i have multiple rows but not 1 row.
ActiveSheet.Range("$A$1:$CB$627689").AutoFilter Field:=38, Criteria1:= _
"Max"
ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 23).Select
ActiveCell.FormulaR1C1 = "Others"
Range(Selection, "W" & lRow).Select
Selection.FillDown
ActiveSheet.Range("$A$1:$CB$627689").AutoFilter Field:=38, Criteria1:= _
"Max"
ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 23).Select
ActiveCell.FormulaR1C1 = "Others"
Range(Selection, "W" & lRow).Select
Selection.FillDown