+ Reply to Thread
Results 1 to 9 of 9

delete cells until value in equal

  1. #1
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    delete cells until value in equal

    hi,

    if i have 12 in cell a1 and 24 in cell f1 i want to be able to delete or adjust value in cells b1, c1, d1, e1.

    example a1 = 12 b1 = 2, c1 = 4, d1= 7, e1= 11.
    i want to delete the values in b1,c1, and adjust d1 to 1 and then adjust f1 to 12 which equale a1.

    this can happen in 200 cells
    is there a macro that can do this

    thank steve

  2. #2
    Forum Contributor
    Join Date
    08-19-2006
    Posts
    116
    Hi Steve
    Please Login or Register  to view this content.
    Last edited by VBA Noob; 12-17-2006 at 12:27 PM.

  3. #3
    Forum Contributor
    Join Date
    08-19-2006
    Posts
    116
    Please Login or Register  to view this content.
    If you want blanks and not 0 and if 12 is just an example, you can use this macro (it's the same in fact less the first instruction)
    Please Login or Register  to view this content.
    Last edited by VBA Noob; 12-17-2006 at 01:49 PM.

  4. #4
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723
    hi raiby

    thanks but i have mislead you

    the value in all the columns could be different
    steve

  5. #5
    Forum Contributor
    Join Date
    08-19-2006
    Posts
    116
    Quote Originally Posted by stevekirk
    hi raiby

    thanks but i have mislead you

    the value in all the columns could be different
    steve
    Please Steve , give an example because i don't understand what you want to do.

  6. #6
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723
    column a, b, c, d, e, f
    row 1 12, 2, 4, 7, 13, 24
    row 2 6, 1, 2, 4, 6, 13
    row 3 11, 1, 4, 4, 3, 11
    row 4 25, 6, 3, 16, 20, 45

    i need to delete or alter columns b,c,d,e,and f to suit a in each row f shoulod end up the same as a
    the rows could be a varible lengh
    thanks
    steve
    Last edited by stevekirk; 12-17-2006 at 01:53 PM.

  7. #7
    Forum Contributor
    Join Date
    08-19-2006
    Posts
    116
    If i execute my macro, i have

    12 1 13 12
    6 1 6 6
    11 1 3 11
    25 1 20 25

    According to me, it works. Could you say if you want this result? You don't see the blanks but in fact, there are blanks on the sheet. The columns A and F are the same.

  8. #8
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723
    hi,
    hi raiby
    my numbers where not correct now correct
    row 1 12, 2, 4, 7, 13, 26
    row 2 6, 1, 2, 4, 6, 13
    row 3 11, 1, 4, 4, 3, 12
    row 4 25, 6, 3, 16, 20, 45


    results should be
    row 1 12, 0 0 0 12,
    row 2 6, 0, 0, 0, 6, 6
    row 3 11, 0 4, 4, 3, 11
    row 4 25, 0, 0, 5, 20, 25


    i only want it to calcuate until it reaches the last row with data in it

    steve

  9. #9
    Forum Contributor
    Join Date
    08-19-2006
    Posts
    116
    Hi Steve

    I come back but the situation's becoming less clear.Where's the mathematical logic?
    If i study the data, i see on the first row, 6 numbers before and 5 numbers after alteration.On the other hand, the number is the same with other rows.Secondly, you have 3 times 0 on the second first rows. That's why,in my first post, i have written:
    Please Login or Register  to view this content.

    But, you want:
    11 0 4 4 3 11
    I'm sorry but i'm lost.The other members will understand your wait(ing) maybe.
    Last edited by VBA Noob; 12-17-2006 at 03:39 PM.

+ 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