SkysLastChance Posted July 25, 2022 Posted July 25, 2022 (edited) $oExcel.ActiveSheet.AutoFilter.Range.Rows.Columns(30).SpecialCells($xlCellTypeVisible).Interior.ColorIndex = 37 $oExcel.ActiveSheet.AutoFilter.Range.Rows.Columns(30).SpecialCells($xlCellTypeVisible).Value = 0 I have a script that is filtering a range of data using the code above. I am using this to highlight and change the value to 0 in column 30 (AD) (Filtred Data Only) However, I don't want to include the header. What would be the a good/clean way to exclude the header row? Otherwise, I am just planning to re-fill in the header row in with _Excel_Rangewrite. Edited July 25, 2022 by SkysLastChance Spelling You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
Solution SkysLastChance Posted July 25, 2022 Author Solution Posted July 25, 2022 (edited) Local $xlup = -4162 $LastRow = $oWorkbook.ActiveSheet.Range("A1000000").End($xlup).Row $oExcel.ActiveSheet.AutoFilter.Range.Rows("2:" & $LastRow).Columns(30).SpecialCells($xlCellTypeVisible).Interior.ColorIndex = 37 $oExcel.ActiveSheet.AutoFilter.Range.Rows("2:" & $LastRow).Columns(30).SpecialCells($xlCellTypeVisible).Value = 0 This seemed to do the trick. Edited July 25, 2022 by SkysLastChance You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now