Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default Auto number on sales sheet

I have created a sales sheet template in excel 2003 and would like it to
generate a unique number every time it is opened. the file would then be
saved as a new name, but when you reopened the template it put the next
number in.

any help would be appreciated
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 515
Default Auto number on sales sheet

In your workbook open event, insert code to increment the number
I normally read the cell's value into a variable, then increment the number
on pasting it back to the sheet.

Something like

vNumber = Range("your nr cell").value
Range("your nr cell")= vNumber+1
ActiveWorkbook.save

--
HTH

Kassie

Replace xxx with hotmail


"Adam" wrote:

I have created a sales sheet template in excel 2003 and would like it to
generate a unique number every time it is opened. the file would then be
saved as a new name, but when you reopened the template it put the next
number in.

any help would be appreciated

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default Auto number on sales sheet

I tried this, but it did not work.

Any other ideas?

"Kassie" wrote:

In your workbook open event, insert code to increment the number
I normally read the cell's value into a variable, then increment the number
on pasting it back to the sheet.

Something like

vNumber = Range("your nr cell").value
Range("your nr cell")= vNumber+1
ActiveWorkbook.save

--
HTH

Kassie

Replace xxx with hotmail


"Adam" wrote:

I have created a sales sheet template in excel 2003 and would like it to
generate a unique number every time it is opened. the file would then be
saved as a new name, but when you reopened the template it put the next
number in.

any help would be appreciated

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 515
Default Auto number on sales sheet

Let's try again.

Press <Alt<F11
In the left hand window, rightclick on ThisWorkbook
In the right hand window, there are two dropdown boxes. Click on the arrow
in the lefthand one, and select Workbook
A new procedure will open, called Private Sub Workbook_Open()
followed by a blank line, and then End Sub.
In the blank line insert the following:
Dim vNumber as variant and press <Enter
Now, say you use cell F10 as the number, then enter:
vNumber= Range("F10")
Range("F10")=vNumber+1
activeworkbook.save
Below that will now appear End Sub
close the VBA window, by clicking the X on the right top.

Insert a value in F10, then save your file.
Close the file.
When you now re-open the file, the number will increment by 1

--
HTH

Kassie

Replace xxx with hotmail


"Adam" wrote:

I tried this, but it did not work.

Any other ideas?

"Kassie" wrote:

In your workbook open event, insert code to increment the number
I normally read the cell's value into a variable, then increment the number
on pasting it back to the sheet.

Something like

vNumber = Range("your nr cell").value
Range("your nr cell")= vNumber+1
ActiveWorkbook.save

--
HTH

Kassie

Replace xxx with hotmail


"Adam" wrote:

I have created a sales sheet template in excel 2003 and would like it to
generate a unique number every time it is opened. the file would then be
saved as a new name, but when you reopened the template it put the next
number in.

any help would be appreciated

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make excel sheet generates an auto number ghost Excel Discussion (Misc queries) 3 July 23rd 07 03:08 PM
A number of auto filters in one sheet. Janis Excel Discussion (Misc queries) 7 July 7th 07 08:40 PM
A number of auto filters in one sheet? Is it possible? Janis Excel Discussion (Misc queries) 2 July 2nd 07 10:54 PM
Sales Sheet brettingsworth Excel Discussion (Misc queries) 3 July 2nd 06 08:49 PM
I need a daily sales sheet to pull from monthly figures sheet Draegen Excel Worksheet Functions 0 April 24th 05 05:58 AM


All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"