Results 1 to 22 of 22

Conditional Delete Cells and shift to the left

Threaded View

  1. #1
    Registered User
    Join Date
    06-28-2010
    Location
    Posen, Poland
    MS-Off Ver
    Excel 2000
    Posts
    46

    Conditional Delete Cells and shift to the left

    Hi,

    I have an input data like that:
    --A-B-C-D-E-F-G
    1-5-7-7-7-5-7-5
    2-7-5-5-5-7-5-7
    3-5-5-5-7-7-5-5
    and so on...

    an output data I need:
    --A-B-C-D-E-F-G
    1-7-7-7-5-7-5
    2-7-5-5-5-7-5-7
    3-7-7-5-5
    and so on...

    as above, macro must to delete number 5 from left to right until not contain other number, and shift to left

    my problem is similar to below:
    Sub Account_or_something()
    '1. http://www.mrexcel.com/forum/excel-questions/545536-conditional-delete-cells-right.html
    '2. other codes here: http://www.ozgrid.com/forum/showthread.php?t=160748
    'searching by google fraze: "end sub" "End(xlToLeft)" "until" "delete cells"
    
    Do While [a1] <> "5"
            [a1].Delete shift:=xlToLeft
        Loop
    End Sub
    above macro works good, but only for one row...

    any help?

    ps. I have also other variant my data, like this:

    input data:
    --A-B-C-D-E-F-G
    1-5-6-3-8-4-1-5
    2-9-5-5-5-6-5-44
    3-5-5-5-6-4-5-5
    and so on...

    output data:
    --A-B-C-D-E-F-G
    1-6-3-8-4-1-5
    2-9-5-5-5-6-5-44
    3-6-4-5-5
    and so on...
    Last edited by markos97; 06-28-2013 at 04:19 AM.

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