Thread: Code Help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Code Help

Shawn,

You can shift data up or to the left only...
xlShiftToLeft or xlShiftUp

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Shawn"
wrote in message
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????
--
Thanks
Shawn