SoftwareTipsandTricks Forum

Go Back   SoftwareTipsandTricks Forum > Software > Software Problems and Useful Utilities
User Name
Password


Excel help needed

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes

  #1  
Old 01-26-2003, 08:42 AM
Tombola Offline
Junior Member
 
Join Date: Jan 2003
Posts: 1
Excel help needed

Can anyone tell me a simple method of getting Excel to produce consecutive numbers to be used as references?

I am trying to create a basic macro that will produce an invoice, and need to assign each invoice with a unique reference number each time the macro is run, with each invoice having a reference number one higher than the previous one.

If anyone knows of a fairly straightforward way of achieving this I will be extremely grateful!

Thanks.
Reply With Quote

  #2  
Old 02-16-2003, 07:22 PM
Tom Urtis Offline
Junior Member
 
Join Date: Feb 2003
Location: Silicon Valley, California USA
Posts: 6
Send a message via AIM to Tom Urtis Send a message via Yahoo to Tom Urtis
Find the little Excel workbook icon just to the left of the File menu option, near the upper left corner of your workbook window. Right click on that icon, left click on View Code, and paste the following code into the large white area that is the Workbook module.

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''

Sub Workbook_Open()
Worksheets("Sheet1").Range("A1").Value = Worksheets("Sheet1").Range("A1").Value + 1
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''

Modify for sheet tab name and the cell you want to have your invoice number be incremented.

To return to the worksheet, press Alt+Q.
__________________
Tom Urtis
Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with External Links in Excel ejooste Windows XP 2 02-18-2007 05:03 PM
Excel 2002 wolfman Software Problems and Useful Utilities 0 02-16-2004 10:35 AM
Importing large text into Excel RawMeat Software Problems and Useful Utilities 0 01-18-2004 10:05 AM
Excel Date Format Help Needed! aeromark Software Problems and Useful Utilities 2 02-06-2003 05:59 AM
Excel Help NMS252 Software Problems and Useful Utilities 1 12-22-2002 10:37 AM



All times are GMT -5. The time now is 03:44 PM.


Designed by eXtremepixels. Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.3.2 © 2005, Crawlability, Inc.