G
Guest
What is wrong with this code?
Dim xRange As Range
Dim xCell As Range
For Each xCell In Sheets("CDPTR").Range("A2:CA2")
If xCell.Value = 0 Then
If xRange Is Nothing Then
Set xRange = xCell
Else
Set xRange = Union(xRange, xCell)
End If
End If
Next xCell
xRange.Delete Shift:=xlToRight <<<< Here I get an
error???
I used to have this set up to work on a column and it shifted deleted cells
up.
I need it to work on a row now, though, and to shift the deleted cells to
the right????
Dim xRange As Range
Dim xCell As Range
For Each xCell In Sheets("CDPTR").Range("A2:CA2")
If xCell.Value = 0 Then
If xRange Is Nothing Then
Set xRange = xCell
Else
Set xRange = Union(xRange, xCell)
End If
End If
Next xCell
xRange.Delete Shift:=xlToRight <<<< Here I get an
error???
I used to have this set up to work on a column and it shifted deleted cells
up.
I need it to work on a row now, though, and to shift the deleted cells to
the right????