Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Lozza77
 
Posts: n/a
Default increment version number

Is there anyway to automatically increment a number in a spreadsheet
everytime the document is saved? ie version number?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default increment version number

Paste following code in Workbook's code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Me.Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
End Sub

HTH
--
AP

"Lozza77" a écrit dans le message de
news: ...
Is there anyway to automatically increment a number in a spreadsheet
everytime the document is saved? ie version number?



  #3   Report Post  
Posted to microsoft.public.excel.misc
Lozza77
 
Posts: n/a
Default increment version number

Thanks Ardus.

How do you edit the workbooks code or do you mean paste it into a cell?
Sorry - I'm a novice!

Regards,
Louren.



"Ardus Petus" wrote:

Paste following code in Workbook's code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Me.Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
End Sub

HTH
--
AP

"Lozza77" a écrit dans le message de
news: ...
Is there anyway to automatically increment a number in a spreadsheet
everytime the document is saved? ie version number?




  #4   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default increment version number

Right-click on the Excel icon on top left of your worksheet,
then select Code.
Paste the code in the newly opened window.
Get back to Excel (vlick on Excel icon)

Save your workbook: the version number will go up by 1

HTH
--
AP

"Lozza77" a écrit dans le message de
news: ...
Thanks Ardus.

How do you edit the workbooks code or do you mean paste it into a cell?
Sorry - I'm a novice!

Regards,
Louren.



"Ardus Petus" wrote:

Paste following code in Workbook's code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Me.Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
End Sub

HTH
--
AP

"Lozza77" a écrit dans le message de
news:
...
Is there anyway to automatically increment a number in a spreadsheet
everytime the document is saved? ie version number?






  #5   Report Post  
Posted to microsoft.public.excel.misc
Lozza77
 
Posts: n/a
Default increment version number

Brilliant!

That works perfectly - thanks very much Ardus.

"Ardus Petus" wrote:

Paste following code in Workbook's code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Me.Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
End Sub

HTH
--
AP

"Lozza77" a écrit dans le message de
news: ...
Is there anyway to automatically increment a number in a spreadsheet
everytime the document is saved? ie version number?




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
vlookup with more than number to be retrieved martelie Excel Worksheet Functions 1 October 8th 05 07:33 AM
Preceding a number by zeros, that is still a number Michele Excel Worksheet Functions 1 September 14th 05 01:06 PM
Number of labels on X-axis one more than number of values on Y-axi Gudrun Charts and Charting in Excel 5 August 26th 05 01:55 PM
Need number of Saturdays and number of Sundays between 2 dates Class316 Excel Worksheet Functions 1 June 10th 05 02:47 AM
How do I automatically increment worksheet number when pasting a . Mr Keldor Excel Worksheet Functions 1 April 21st 05 06:06 PM


All times are GMT +1. The time now is 02:44 PM.

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

About Us

"It's about Microsoft Excel"