Consulting

Page 1 of 2 1 2 LastLast
Results 1 to 20 of 25

Thread: Solved: Excel accounting spreadsheet macro

  1. #1
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location

    Smile Solved: Excel accounting spreadsheet macro

    Hi everyone ! Been reading this forum for ages and gleaned loads of information but can't find a solution to my problem.

    I run a small business and have set up the accounts on a spreadsheet. Managed to work out functions etc to transfer info from one worksheet to another but I need a macro (Ithink) to automatically 'log' info from an invoice. I would like ideally to auto list date, inv no, net, tax, total from the invoice onto another worksheet row by row when the Invoice is saved.

    I have managed with great difficulty to write a macro to 'Save' from a button. I have shown this below.

    [VBA]Sub Rectangle17_Click()
    '
    ' Rectangle17_Click Macro
    ' Macro recorded 21/09/2008 by Eileen
    'Dim Lst As String
    Lst = Range("E6").Value & "_SalesInvoice.xls"
    ActiveWorkbook.SaveAs Filename:= _
    Lst _
    , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False
    End Sub[/VBA]

    Is it possible to add to this and log the invoice also?

    Have tried SUMIF "E6" = a certain inv no but the function isn't recognised until the inv is created so can't copy function down the rows !

    Sorry if this is a long drawn out post.

    Thanks for reading this.

  2. #2
    VBAX Expert
    Joined
    Aug 2007
    Location
    Windermere, FL, a 'burb in the greater Orlando metro area.
    Posts
    567
    Location
    Eileen,

    Would it be possible for you to upload an Excel file? Include your code in a module and a sample of the format you wnat to capture the invoice data into with a line showing sample data. Include a second sheet with the invoice for that sample data so we can see what goes where.

    [uvba]code[/uvba]

    Thanks,
    Ron
    Windermere, FL

  3. #3
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location
    Thank you have attached Sample (I hope)

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Eileen,

    ARe you saying that you will create an invoice, on the Sales Invoice Template (which I then presume that you print and send to your customer, and then you want to transfer the data from there to the summary?

    If so, I would do it the other way around, have all the data in the summary, and a simple entry of the invoice number on the invoice would pick up the other data. Table driven.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Expert
    Joined
    Aug 2007
    Location
    Windermere, FL, a 'burb in the greater Orlando metro area.
    Posts
    567
    Location
    Eileen,

    If you have 10 lines of detail on your invoice, do you want those 10 lines to appear in your invoice register, as well?

    Just wondering,
    Last edited by RonMcK; 09-26-2008 at 07:55 AM. Reason: deleted query to Bob; replaced w/ query to Eileen
    Ron
    Windermere, FL

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Ron,

    My thinking that it is far simpler to capture all of your sales information in one go in a table, i.e. a spreadsheet, and then automate the invoice production. It just seems simpler and more logical to me.

    My application model always go, inputs -> data store -> outputs, and the invoice is the output here.

    I certainly wouldn't argue about having some VBA that opened a template and transferred the invoice data to it and printed it, but that is probably unnecessary for Eileen's needs here, and it can be doen with worksheet formulae.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Expert
    Joined
    Aug 2007
    Location
    Windermere, FL, a 'burb in the greater Orlando metro area.
    Posts
    567
    Location
    Bob,

    If I'm following you, the invoice template exists as a worksheet; this worksheet is linked to the invoice register worksheet and is populated with data from the invoice register based on the invoice number Eileen will enter on the invoice. The invoice template worksheet is printed with the copies being distributed to the customer and Eileen's files.

    Am I correct in assuming that no electronic copies of the individual invoices is retained since she can re-create it by re-entering the invoice number on the invoice template?

    Thanks,
    Ron
    Windermere, FL

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Exactly, on all counts. I would never save the invoices as data, they are not data, just a view of the data, and are re-creatable.

    To be honest, I wouldn't save the invoice price or total either, just the VAT rate, the number and the unit price, don't save anything that can be calculated/derived.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  9. #9
    VBAX Expert
    Joined
    Aug 2007
    Location
    Windermere, FL, a 'burb in the greater Orlando metro area.
    Posts
    567
    Location
    Bob,

    Thanks. Good points.

    Cheers!
    Ron
    Windermere, FL

  10. #10
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location
    Hi Guys

    If you read my SUMIF function then the first row will disappear when I change the Inv number. This happens because I'm overwriting the invoice each time and saving it.

    I like the idea of doing the table first and linking it to the invoice but then my VLOOKUP customer contact link would be a bit finnicky.

    I just need the first item 'sold' on the invoice - it very rarely has more than that.

    Thanks for your help (up to now) will fiddle around auto entry for invoice from table.

  11. #11
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    No, it is very simple.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  12. #12
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location
    Thank you so much XLD !

    Not so simple for me

  13. #13
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location
    Hi ! It all was working great but now I find I need more items on Sales Invoice. Any ideas ?

    Thanks

  14. #14
    VBAX Expert
    Joined
    Aug 2007
    Location
    Windermere, FL, a 'burb in the greater Orlando metro area.
    Posts
    567
    Location
    Quote Originally Posted by anovice
    Hi ! It all was working great but now I find I need more items on Sales Invoice. Any ideas ?
    Eileen,

    How many lines do you want to add to your invoices?

    Thanks,
    Ron
    Windermere, FL

  15. #15
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Like this?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  16. #16
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location
    Exactly like that !

    Molto Buono !

  17. #17
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location
    Hi

    Thanks for your help so far but I need more rows on the Sales Invoice Summary. As far as I can work out the function takes it to row 20. Have tried to alter the function but it doesn't work.

    If you could explain how to increase rows I can adjust when required.

    Thanks

  18. #18
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Wherever the formula refers to $A$1:$A$20, change that toe $A$1:$A$n catering for all you will ever need.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  19. #19
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location
    Tried that XLD but still won't work. Sorry to be a pain - it's prob something obvious.

  20. #20
    VBAX Regular
    Joined
    Sep 2008
    Posts
    28
    Location


    XLD are you there ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •