+ Reply to Thread
Results 1 to 7 of 7

Macro to generate the next quote number from another workbook list

  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    7

    Macro to generate the next quote number from another workbook list

    I have a quote form that I would like to have a macro run that will generate the next available quote number from a list in another workbook. Example is P160001 is used then I need to return P160002. I'm not sure on how to get the new number generated with VBA if anyone could help. ALso will the quote form log then have this new number saved so that when I go to generate a new on the next number will be chosen?

    Here is what I start with to look for a new number but not sure how to create one with the code itself.

    Please Login or Register  to view this content.
    Thanks.
    Last edited by tmangus; 01-08-2016 at 04:42 PM.

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Macro to generate the next quote number from another workbook list

    This should give you an idea of one way to do it.

    There is an example file at the bottom.
    Here's the code used:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-07-2013
    Location
    Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro to generate the next quote number from another workbook list

    Skywriter this looks close but I need it to work just a little differently. How do I get it to generate the new number then save it to the quote log so that the next time a generate a new number it looks to the last cell of data in the column?

    Thanks!

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Macro to generate the next quote number from another workbook list

    I wrote it to cell F2 to show you how to write it back to your sheet.

    Since I have no idea of the layout of your quote log, sheet names, ranges the data is in etc...., what am I to do?

  5. #5
    Registered User
    Join Date
    06-07-2013
    Location
    Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro to generate the next quote number from another workbook list

    Sorry Skywriter if I did not ask a clear enough question.

    What I'd like to see is if when you generate a new quote number in A2 that is from F2 that F2 then stays static. Then the next time the Macro is ran A2 will be generated a new quote number from F3. Column F will have a running log of numbers used with the new quote number always being generated from the last number in the list.

    Thanks for trying to help me out!

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Macro to generate the next quote number from another workbook list

    See how this works. This code assumes there is at least 1 quote number already in existence.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by skywriter; 01-08-2016 at 07:35 PM. Reason: Edited the code and uploaded a new file.

  7. #7
    Registered User
    Join Date
    06-07-2013
    Location
    Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro to generate the next quote number from another workbook list

    Thank you Skywriter for all your help! I was able to get this code working for what I needed.

+ 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. [SOLVED] Macro that will generate quote in word
    By blackburnsexcel in forum Excel General
    Replies: 2
    Last Post: 12-02-2014, 08:12 PM
  2. MACRO to generate serial number in shared workbook
    By mouzie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-30-2014, 05:31 AM
  3. [SOLVED] How to generate a list of all Sheets within a workBOOK
    By xtreme4u in forum Excel General
    Replies: 1
    Last Post: 09-30-2014, 05:39 PM
  4. Macro to generate a unique number on a shared workbook.
    By adil.master in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-30-2013, 04:22 PM
  5. Replies: 1
    Last Post: 06-26-2013, 07:08 PM
  6. Macro to generate next number from last cell of another workbook
    By larzep in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 03-06-2012, 02:12 AM
  7. Macro to Generate new Quote TaB
    By robertguy in forum Excel General
    Replies: 9
    Last Post: 03-23-2009, 01:54 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