Hey hey everyone,
I wonder if anyone can help. I have a range (about 11 columns and potentially thousands of rows) which I've copied a formula which could give a result of "" into then copied and pasted as values. Simple enough.
But what I need to do now is delete the "blank" cells and replace the cell with the one to the left. Unfortunately I can't just use xlCellTypeBlanks because Excel it it's wisdom doesn't except "" as a blank cell.
I have been using this code
but as the range is so huge this dramatically increases the time the code takes to run.
Any help is much appreciated.
I wonder if anyone can help. I have a range (about 11 columns and potentially thousands of rows) which I've copied a formula which could give a result of "" into then copied and pasted as values. Simple enough.
But what I need to do now is delete the "blank" cells and replace the cell with the one to the left. Unfortunately I can't just use xlCellTypeBlanks because Excel it it's wisdom doesn't except "" as a blank cell.
I have been using this code
Range("U6:AS" & Range("A6").End(xlDown).Row).Replace What:="", Replacement:="0", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=FalseDim i As Long
Dim j As Long
Range("U6:AE" & Range("A6").End(xlDown).Row).Select
For i = Selection(Selection.Count).Row To Selection.Cells(1, 1).Row Step -1
For j = Selection(Selection.Count).Column To Selection.Cells(1, 1).Column Step -1
If Cells(i, j).Value = 0 Then Cells(i, j).Delete shift:=xlShiftToLeft
Next j
Next i
but as the range is so huge this dramatically increases the time the code takes to run.
Any help is much appreciated.