+ Reply to Thread
Results 1 to 3 of 3

Insert row in numerical order

  1. #1
    Registered User
    Join Date
    08-07-2004
    Location
    Colorado
    MS-Off Ver
    365
    Posts
    62

    Insert row in numerical order

    I'm up to more no good it would appear.

    I need to be able to enter a number in a cell, A1 for example, activate a button, and have that value placed into a new row below in numerical order, then the entry in A1 deleted so more entries can be made

    For example, if F1=6, G1=8 and H1=9, if I enter 7 in A1 and run the macro, a new row is created (G becomes H, H becomes I, etc) and 7 is placed in G1, A1 is cleared.

    What I'm up to is inventory where the items are all numbered and more of the same number can show up with a larger number, like XXXX1 and XXXX2 that are the same item, or different item YYYY1 that may only show up once. Row gets deleted when inventory is removed from "back room" and goes to sales area so the list will only carry 40 or so items at any one time.

    Creating the row isn't an issue - placing it between existing rows based on the existing cell values and on the new entered value I don't have any good ideas on.

    My attached sheets show a before and after desired result
    Attached Files Attached Files
    Last edited by itsunclebill; 02-22-2010 at 09:51 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Insert row in numerical order

    Hello itsunclebill,

    I add this macro to button in the attached workbook. This will insert the new inventory data when clicked. The macro adds the new inventory items to the end of the list, provided there is room, and then sorts the inventory data. This places the new items in the correct place. Here is the button code.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-07-2004
    Location
    Colorado
    MS-Off Ver
    365
    Posts
    62

    Re: Insert row in numerical order

    Thank you Leith. Works perfectly. Not at all what I expected to see but makes sense now that I see how it's done.

+ 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