ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   new version# when opening file (https://www.excelbanter.com/excel-programming/397637-new-version-when-opening-file.html)

Jayjay

new version# when opening file
 
Hi,

I need a spreadsheet where a cell (fx."A1") shows the latest report version,
i.e. the cell needs to change the version-number from # to #+1, when you open
the report.
Does anyone know a macro which can do this ?

BR,
Jakob

Bob Phillips

new version# when opening file
 
Private Sub Workbook_Open()
With ThisWorkbook.Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
ThisWorkbook.Save
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jayjay" wrote in message
...
Hi,

I need a spreadsheet where a cell (fx."A1") shows the latest report
version,
i.e. the cell needs to change the version-number from # to #+1, when you
open
the report.
Does anyone know a macro which can do this ?

BR,
Jakob




Jayjay

new version# when opening file
 
Thanks Bob,
Perfect!

"Jayjay" wrote:

Hi,

I need a spreadsheet where a cell (fx."A1") shows the latest report version,
i.e. the cell needs to change the version-number from # to #+1, when you open
the report.
Does anyone know a macro which can do this ?

BR,
Jakob



All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com