In my macro, I have a segment that looks at a range, and finds and fills empty cells.
Range("E10:A" & CStr(bottom - 1)).Select Selection.SpecialCells(xlCellTypeBlanks).Select Selection.Value = "N/A"
Where
bottom = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
This works great when an empty cell is present within the range, but throws "1004 Error: No cells were found." on the line specialcells.select. I am having trouble thinking about how to easily solve this problem.
I understand that I can run a loop through a range to check empty cells first, but I feel that this method will be slow and awkward.
Does anyone have a faster and / or simpler solution?
PS I know that I can consolidate my lines of code above, I just explained it as follows, so that it is easier to understand;
Range("E10:A" & CStr(bottom - 1)).SpecialCells(xlCellTypeBlanks).Value = "N/A"
source share