With ActiveSheet
lastrow = .Cells(.Rows.Count, "C").End(xlUp).Row
LastCol = .Cells(5, .Columns.Count).End(xlToLeft).Column
End With
ActiveSheet.Range(Cells(5, 3), Cells(lastrow, LastCol)).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent2
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
I'm using the above code to highlight blank cells in a dynamic range. I was only able to get this to work with the use of select which i don't like to use in the macros.
Is there any way i can refer to ActiveSheet.Range(Cells(5, 3), Cells(lastrow, LastCol))
and then select all the blank cells in it without using select?
Thank you!
Comments
Post a Comment