+ Reply to Thread
Results 1 to 9 of 9

To copy, move, and then delete old row of data left.

  1. #1
    Forum Contributor
    Join Date
    11-11-2007
    Posts
    263

    To copy, move, and then delete old row of data left.

    I have a code I have been working on, I can get the first two parts working, but I can't get the final bit working... the delete old code.

    Please Login or Register  to view this content.
    Attached is the sheet. The script is meant to run on BackOrder.

    If you see it is meant to run specifically in columns B through N. It copies everything over to the left, but it doesn't delete the old column's data... that is the part I need to finish.

    That is the part I can't figure out, if anyone who is more savvy than me can please, it be appreciated.

    Just a heads up, the code is wrong in the page, I corrected it on the script here, so please copy and paste, it will make more sense then.
    Attached Files Attached Files
    Last edited by Cyberpawz; 04-12-2012 at 12:46 PM. Reason: Correcting script.

  2. #2
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: To copy, move, and then delete old row of data left.

    In simple English, what is the worksheet supposed to do? Explain as much as you can if you don't mind.

    Thanks,

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: To copy, move, and then delete old row of data left.

    Use this:

    Please Login or Register  to view this content.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  4. #4
    Forum Contributor
    Join Date
    11-11-2007
    Posts
    263

    Re: To copy, move, and then delete old row of data left.

    Quote Originally Posted by Kelshaer View Post
    Use this:

    Please Login or Register  to view this content.
    Ummm, I hate to say it, but it didn't even come close to do what I wanted... It just moved everything over left, the format has to stay the same. B has to be the first row, that being said, it didn't delete any of the copied rows either.

  5. #5
    Forum Contributor
    Join Date
    11-11-2007
    Posts
    263

    Re: To copy, move, and then delete old row of data left.

    Quote Originally Posted by 111StepsAhead View Post
    In simple English, what is the worksheet supposed to do? Explain as much as you can if you don't mind.

    Thanks,

    I already have.... but I'll repeat if I have to.

    The script I have written copies all columns not directly next to each other over to the first left empty column it finds... what I want it to do is that once it has copied the columns over to delete the original so it isn't left there after the script has run.

    That is as simple as I can get. Also the script has to be simple and straight forward like mine, because this is going into a much larger script, and must be self explanatory 3 months or 6 years down the road by just looking at it.

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: To copy, move, and then delete old row of data left.

    Sorry Cyberpawz but nothing in your original post says that you want to move or delete rows as well.

  7. #7
    Forum Contributor
    Join Date
    11-11-2007
    Posts
    263

    Re: To copy, move, and then delete old row of data left.

    Quote Originally Posted by Kelshaer View Post
    Sorry Cyberpawz but nothing in your original post says that you want to move or delete rows as well.
    Actually I said columns, not rows, I can delete columns without issues... I thought I was quite clear.

    If you see it is meant to run specifically in columns B through N. It copies everything over to the left, but it doesn't delete the old column's data... that is the part I need to finish.
    That being said, I am still stuck.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: To copy, move, and then delete old row of data left.

    Try this - cel = cel.Offset(0, 1):cel.Offset(0, 1)="" inserted as below
    Please Login or Register  to view this content.
    Last edited by arlu1201; 04-21-2012 at 02:21 PM. Reason: Use code tags.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: To copy, move, and then delete old row of data left.

    SpecialCells will cause an error if there are no cells containing the criteria, in this case blanks. This method should always be used with an error statement to avoid issues.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1