Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete and shift certain cells at once

Status
Not open for further replies.

mecmax

Technical User
Jan 17, 2007
1
US
in a dataset i use a loop to find a cell, and I want to delete and shift up that cell and 12 othter cells adjacent to it. Could I do it at once, or I have to create another loop to delete and shift each of 13 cells?
 
once you have found the cell, use RESIZE to resize the range and apply the delete/shift to that new range

e.g.

set fCell = Columns("A").find("TextToFind")

if not fCell is nothing then
fCell.resize(1,13).delete shift = whateveryourshiftis
...
...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top