+ Reply to Thread
Results 1 to 8 of 8

VBA Help copying lines from a list to the order that I want

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    london
    MS-Off Ver
    Excel 2016
    Posts
    107

    VBA Help copying lines from a list to the order that I want

    Hi all,

    I attach here an Excel file where I ask you help to do something.

    As you can see, in column AO I have a series of numbers. What I would like to do, is a VBA code that could read that number, and if that number is the same that the row number: Ok, don't do nothing. If that number is different from the row number then, it should copy all values from the "green-number" row to the row where that number is. A little bit confused right?

    An example:

    Read AO46. The number read is 48. Then It should copy all values from row 48 to row 46.

    Next.

    Read AO47. The number read is 49. Then it should copy all values from row 49 to row 47.

    Next.

    Read AO48. The number read is 52. Then it should copy all values from row 52 to row 48.

    ....

    And this until the end of the sheet. Can someone give me a help out?

    Thank you all
    help.xlsm

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: VBA Help copying lines from a list to the order that I want

    Hi ropbasuel,
    try it
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    london
    MS-Off Ver
    Excel 2016
    Posts
    107

    Re: VBA Help copying lines from a list to the order that I want

    Dear nilem,

    Thank you for your answer.

    This is not quite what I want. I will try to explain better. The green cells (AO column) I don't want that to be changed.

    All I want is that the macro can read the "number-value" of that cell and then go to the line of that "number-value" and then copy that line to the place where first the value was read.

    The AO column should not be changed, it's only for reading the number that is on the cells.

    If I'm not making myself understandable please tell me so!

    Thank you so much for trying to help me

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: VBA Help copying lines from a list to the order that I want

    ok, maybe so
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-09-2013
    Location
    london
    MS-Off Ver
    Excel 2016
    Posts
    107

    Re: VBA Help copying lines from a list to the order that I want

    Dear nilem,

    Thank you again for your help, but I am afraid the code isn't doing what I want.

    Let's focus on the line 46. As the AO46 is the number "48", then all line 48 should be copied to this line 46. But after running the macro, at least this line stays the same as before..

    I'm sorry if I'm giving to much work..

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: VBA Help copying lines from a list to the order that I want

    Oops, I inattentively read that you need
    Now I hope everything is correct.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    05-09-2013
    Location
    london
    MS-Off Ver
    Excel 2016
    Posts
    107

    Re: VBA Help copying lines from a list to the order that I want

    Dear nilem,

    Thank you so much for you help! Now it works perfectly! Thank you!!!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA Help copying lines from a list to the order that I want

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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