select and delete cells based on current location


Posted by Steve on September 15, 2001 8:09 AM

Thanks to all you guys for your continued help.

I am creating a macro that will take me to a cell on a sheet (done that successfully) and delete the contents of a block of cells. What I need to know is how to complete the macro by having it select the cell it is already in along with the next 8 cells to its right, delete these cells and move all cells below it up.

Thanks
Steve

Posted by Tom Urtis on September 15, 2001 8:58 AM

Is this the code you are looking for? It assumes that the cell you first go to is B3, so adjust that part of this code for whatever cell you know how to first get to.

Range("B3", Range("B3").Offset(0, 8)).Select
Selection.Delete Shift:=xlUp
Range("B3").Select

Hope this helps.

Tom Urtis



Posted by Steve on September 15, 2001 9:49 AM

thanks

Thanks Tom