I want my code to take a user defined range and delete any blank cells as well as the cell one to the right of the blank cell.
Here is what I have so far:
Sub CleanupAccountsinYear()
Dim selectedrng As Range
Range(Selection, Selection).Select
Set selectedrng = Application.Selection
For Each Cell In selectedrng
If Cell.Value = "" Then
Cell.Activate
Range(ActiveCell, Cells((ActiveCell.Row), (ActiveCell.Column) + 1)).Select
'Missing Vital Component
End If
Next Cell
End Sub
The problem is that each time I delete the selected range and the macro moves on to the next cell it will skip a cell. My thinking is I may have to store the ranges in a union and delete them from there but that has proven to be a bit difficult. Is there an easier way to solve this?