Thread: Offset Code
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Todd Huttenstine[_2_] Todd Huttenstine[_2_] is offline
external usenet poster
 
Posts: 237
Default Offset Code

I used the below method to delete the next 4 cells to the
right of Cells(i1, "N"), but there seems as though there
would be an easier way to do this. I have to put the code
for the cells I want to delete before the code to delete
the actual Cells(i1, "N") so I can use that as a reference.



Cells(i1, "N").Offset(0, 1).Delete
Shift:=xlShiftUp
Cells(i1, "N").Offset(0, 2).Delete
Shift:=xlShiftUp
Cells(i1, "N").Offset(0, 3).Delete
Shift:=xlShiftUp
Cells(i1, "N").Offset(0, 4).Delete
Shift:=xlShiftUp
Cells(i1, "N").Delete Shift:=xlShiftUp



-----Original Message-----
I have the following code that deletes a certain cell...

Cells(i1, "N").Delete Shift:=xlShiftUp

I would like it to also delete the next 4 cells to the
right using the same delete method? I would assume I
would have to use an offset method. Can anyone please
tell me how to do this?

Thank you


Todd Huttenstine
.