+ Reply to Thread
Results 1 to 6 of 6

somone please help me

  1. #1
    Registered User
    Join Date
    02-04-2005
    Posts
    3

    Question somone please help me

    i am not an experienced exel user, but I am pretty computer literate in general, here is my situation, i have an invoice template that i got and modified slightly (compaany logo and a couple of other adjustments. What I am trying to do is get the invoice number to increase by one every time I open the file, I thought that this would be an easy task, but after extensive bowsing I am still not there, I trie a couple of different things, viewing the code, and pasting this
    Private Sub Workbook_Open()
    Range("A1") = Range("A1") + 1
    ActiveWorkbook.Save
    End Sub
    but changing a1 to the cell I want the numbet to change in, this does not work for me, I think one of the posts said it was because I am using an excel template file to start with??????? I am not here by means of lack of effort, I would really like to figure this out, I would also like to add some drop down menus, but that seems way out of my league at this point in time, could someone PLEASE help me figur out this numbering invoices thing, I am loosing sleep over this
    I can be emailed at [email protected] if anyoen can help me I would really appreciate that

  2. #2
    Forum Contributor
    Join Date
    01-11-2004
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    388
    Hi!

    Have a look at

    http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

    Alf

  3. #3
    Registered User
    Join Date
    02-04-2005
    Posts
    3

    I tried

    i looked at that link, and although I appreciate it, it is way beyond my level at the moment. That looks like complete code wriiting, is there no addon or anything I can buy that will do what I'm looking for, drop dpwn menus with items and invoice sequential numbering

  4. #4
    Forum Contributor
    Join Date
    01-11-2004
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    388
    Hi!

    Worksheet functions will not keep a running record of the last invoice number you used.

    To do this you will have to use VBA in some form, but it can be very simple for a single task.

    You could designate cell IV1 to hold the number of the last invoice produced.

    Then when you start your next invoice, Excel would look at IV1: add 1 and use the result as the number for the next invoice: then it would update IV1 to the new number by adding 1 to it.

    It is this last operation (increasing IV1's value by 1) which needs VBA: not a complex business.

    The first thing to determine is what will trigger the change? For example, what operation do you use to "send off" an invoice? Do you click a button or what?

    Given a few more facts, this needn't be difficult

    Alf

  5. #5
    Registered User
    Join Date
    02-04-2005
    Posts
    3

    not sure what you mean

    alf, thank yoou for your help so far, what i am trying to do is have an invoice template, if that will work, if not I can create my own invoice and just save it as a regular .xls file, I want to be able to open the file from its directory and when I do I want the invoice to automaticlly increase its deisgnated invoice numer cell by one. So what i want is to open the file, the inivoice number shoud be oone greater then last time I opened it, I will then fill in whatever i need to, then print the invoice, then save a copy of it to my computer, then delete the blanks I filled, then resave. Soo now next time I open, blanks will be empty and invoice number will be one greater.

  6. #6
    Forum Contributor
    Join Date
    01-11-2004
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    388
    Hi!

    Put the following in the module called ThisWorkbook (see later).

    Private Sub Workbook_Open()
    Worksheets("Sheet1").Range("D3") = Worksheets("Sheet1").Range("D3") + 1
    End Sub

    This assumes your worksheet is called Sheet1 and that the invoice number is to show in cell D3. Change these as necessary.

    How to put it in the module?

    Rightclick a sheet tab and select View Code from the dropdown menu.
    Look on the left and identify ThisWorkbook at the end of the list of modules.
    Doubleclick to activate it.
    Paste the sub into that sheet.

    Return to the worksheet (use the tab at the bottom of the screen or any of the various ways of doing that. Put the number of your first invoice in D3.

    Save the workbook and close it.
    Reopen the workbook. Look at D3.

    Alf

+ 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