invoice template

Score
0
Vote Up
July 6, 2009 at 15:58:55 Pacific
Specs: Macintosh

I'm creating an invoice template but want the invoice number to change every time I open the template. Does anyone know how can I formulate a cell on the spreadsheet so that each time I open the workbook the number in that cell counts up? Thanks

Reply ↓  Report •


#1
Vote Down
Score
0
Vote Up
July 6, 2009 at 16:44:42 Pacific

You will probably need a piece of VBA code to accomplish this.

Try:

Private Sub Workbook_Open()
Range("a1").Value = Range("a1").Value + 1
End Sub

Assuming your Invoice number is in cell A1

MIKE

http://www.skeptic.com/


Reply ↓  Report •

#2
Vote Down
Score
0
Vote Up
July 6, 2009 at 16:58:22 Pacific

Many thanks Mike. I'm afraid I only have very basic Excel knowledge and I don't understand what you mean. Please would you mind explaining (for dummies style!)

Thank you


Reply ↓  Report •

#3
Vote Down
Score
0
Vote Up
July 6, 2009 at 17:20:12 Pacific

My VBA skills are not that much greater than yours, I’m just beginning to delve into it.

To get the code to work you will need to first access the VBA editor:
Press ALT-F11

Once it opens, on the Task Bar, press the Project Explorer button or press CTRL-R

When the Project Explorer window opens, find the line that reads VBAProject followed by your filename and Double Click on the line.

Next, at the bottom of the list that just appeared should be a line that reads “ThisWorkbook”
Double Click it and in the window that appears on the right, paste the code I gave you:

Private Sub Workbook_Open()
Range("a1").Value = Range("a1").Value + 1
End Sub

Press ALT-F11 again to get out of the VBA editor and then save the file.


This should work……..

MIKE

http://www.skeptic.com/


Reply ↓  Report •

Reply to Message Icon Start New Discussion
Related Posts

« QuickBooks File Transfer Can I convert a xls file ... »

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.

Ask the Community!
Describe your Problem
Example: Hard Drive Not Detected on My PC