+ Reply to Thread
Results 1 to 5 of 5

Use Formula or Macro to select next available value from a list, then copying as database

  1. #1
    Registered User
    Join Date
    05-20-2016
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Use Formula or Macro to select next available value from a list, then copying as database

    Hi,
    I haven't been able to formulate my question properly to search on the forum as to what I want to achieve, but basically I need a formula or macro to show the next available Code, then copy and paste data next to that code so that it becomes unavailable next search and builds the database, as shown in the attachment.

    I want the users to enter the item in cell B3, and their initial in D3. Then with a macro or formula, Excel would return the next available Alphanumeric Code from the list in Column "G". Then it would copy the Item and User under column H/I next to the corresponding Code so that the code becomes unavailable for the next item entry.

    It seems simple in principle but can't figure it out. Using Excel 2010. Thanks
    Attached Images Attached Images

  2. #2
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    Re: Use Formula or Macro to select next available value from a list, then copying as datab

    How's this:
    Please Login or Register  to view this content.
    You have to put in the Code Module for the worksheet and not a standard module. It only does something if either B3 or D3 are updated and if both of them have data so there's no issue with which way round the user enters data. Then it simply finds the next database line that has no item and copies the data.
    Last edited by kadeo; 05-20-2016 at 04:27 AM.
    Please click *Add Reputation if I've helped

  3. #3
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Use Formula or Macro to select next available value from a list, then copying as datab

    see attached workbook

    This is the macro that has been placed in the sheet module
    Runs automatically when you amend the value in D3
    Checks and exits sub if C3 is not blank or if B3 contains a value
    Values in B,C & D deleted after G,H,I updated

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If a response has helped then please consider rating it by clicking on *Add Reputation below the post
    When your issue has been resolved don't forget to mark the thread SOLVED (click Thread Tools at top of thread)

  4. #4
    Registered User
    Join Date
    05-20-2016
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Use Formula or Macro to select next available value from a list, then copying as datab

    Thanks Kevin#. I've tested your file and does exactly what I needed. cheers

  5. #5
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Use Formula or Macro to select next available value from a list, then copying as datab

    You are welcome.

    If you add 1 line to @Kadeo 's macro you will find that it does exactly the same thing as my effort. Despite looking looks quite different, the thought process is identical.

    add:
    Please Login or Register  to view this content.
    after:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How can you eliminate a list of words out of a database using a macro
    By MORACH87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2013, 11:55 PM
  2. [SOLVED] Macro is not copying to other sheet, just clearing contents of select case
    By Rokn in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-21-2013, 09:06 AM
  3. Macro to Select Drop Down List
    By rmmohan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2013, 04:20 PM
  4. [SOLVED] Macro to select staff list
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2013, 11:56 AM
  5. Replies: 8
    Last Post: 03-07-2011, 01:43 PM
  6. Macro to select a value from list
    By mgantt87 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-01-2009, 05:22 PM
  7. macro button for database like sheet. Update & ReSort list alphabtzd
    By DoraExplorExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2007, 01:56 AM
  8. How to select a list item by using a macro
    By efernandes67 in forum Excel General
    Replies: 1
    Last Post: 06-03-2007, 04:55 PM

Tags for this Thread

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