+ Reply to Thread
Results 1 to 5 of 5

Library Spread Sheet, with add new book macros

  1. #1
    Registered User
    Join Date
    08-01-2017
    Location
    U.S. Tennessee
    MS-Off Ver
    2010
    Posts
    12

    Library Spread Sheet, with add new book macros

    I run a small library in a prison using Microsoft Excel and I have my data in a table (sortable drop down menu columns and auto colored rows). I want to add a "Add New Book" button to the form that brings up an input box waiting for the me to input the Author, Title, Genre {TEXT}, Price {Currency}, & Type {COMBOBOX} (hardback, softback, paperback). After getting the input I want the macro to generate a unique ID for the book with the prefix based upon the Type selected from the combo box. I need the program to loop through the entire A column of my table and find the lowest available number for that specific selection (hardback, softback, paperback) and the assign that prefix with that number as the book's ID.

    ID example

    hardback
    HH-0105

    softback
    HS-0054

    paperback
    HP-1045

    I want each number to four digits long plus the TYPE- prefix. Below is the form I have created so far but VBA is beyond my ability to code very well. I find it many magnitudes more difficult that C++ or PHP. Thanks for your help.


    Module1
    Please Login or Register  to view this content.
    Forms.UserForm1
    Please Login or Register  to view this content.
    I would have attached an example file but the attache button on this form just brings up a thin horizontal line with no file browser.
    Last edited by lewashby85; 08-09-2017 at 01:11 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Library Spread Sheet, with add new book macros

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to Quick Post button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    08-01-2017
    Location
    U.S. Tennessee
    MS-Off Ver
    2010
    Posts
    12

    Re: Library Spread Sheet, with add new book macros

    Thanks. Here's the file.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Library Spread Sheet, with add new book macros

    Your ID number format is inconsistent, e.g.,
    0917006291.1
    RC1.TD1.1

    What should happen with such?

  5. #5
    Registered User
    Join Date
    08-01-2017
    Location
    U.S. Tennessee
    MS-Off Ver
    2010
    Posts
    12

    Re: Library Spread Sheet, with add new book macros

    I'll be converting all of my IDs to the following formats. HH-#### for hardback, HS-#### for softback, & HP-#### for paperback. Sorry for the long delay, got my internet access her at my job for a bit.

+ 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. Multiple Macros on this spread sheet ... NEED HELP!
    By potthoffw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2016, 11:19 AM
  2. book due records for sorting and placing in text (Library related problem)
    By hrs4545 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2015, 02:25 AM
  3. Replies: 0
    Last Post: 01-19-2015, 03:31 PM
  4. Error copying sheet which contains macros to a new book.
    By fredblogs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2009, 09:33 AM
  5. Replies: 3
    Last Post: 08-23-2008, 06:01 PM
  6. excel-How many macros can one spread sheet have
    By David in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-01-2006, 08:10 AM
  7. Open book, check for macros, close book
    By CLR in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-31-2005, 02:06 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