I have a macro that runs and formats a weekly report of aging invoices. It runs a Vlookup
against the previous week's file to return the updates input by the Buyers. I have an IFERROR put in so that I don't get #N/A
returned. We also have some code written that was intended to change any cells equal to "0," but it's not working.
Instead of changing just the cells equal to 0 to blank, it's clearing ALL cell values, including the updates that were input by the Vlookup. I am nowhere near a code expert, and the person who was helping me with this has taken a new role and is quite busy. I managed to fix a couple other issues with the code, but this has me stumped.
Selection.AutoFilter
ActiveSheet.Range("A1:V" & LastRow).AutoFilter Field:=9, Criteria1:="0"
Range("I2", "I" & LastRow).SpecialCells(xlCellTypeVisible).Select
Set myrange = Selection
If myrange Is Nothing Then
Else
Selection.ClearContents
Selection.FillDown
Selection.AutoFilter
End If