ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I add one to a number everytime I open the same workbook (https://www.excelbanter.com/excel-worksheet-functions/62695-how-do-i-add-one-number-everytime-i-open-same-workbook.html)

Greg

How do I add one to a number everytime I open the same workbook
 
I have a cell number like 1001 and I want it to add to 1002 the next time I
open ithe workbook and 1003 the next time and so on
Thanks
Greg

Bob Phillips

How do I add one to a number everytime I open the same workbook
 
Private Sub Workbook_Open()
With Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
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

RP
(remove nothere from the email address if mailing direct)


"Greg" wrote in message
...
I have a cell number like 1001 and I want it to add to 1002 the next time

I
open ithe workbook and 1003 the next time and so on
Thanks
Greg




Greg

How do I add one to a number everytime I open the same workboo
 
Thanks so Very Much
God Bless
Greg

"Bob Phillips" wrote:

Private Sub Workbook_Open()
With Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
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

RP
(remove nothere from the email address if mailing direct)


"Greg" wrote in message
...
I have a cell number like 1001 and I want it to add to 1002 the next time

I
open ithe workbook and 1003 the next time and so on
Thanks
Greg






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

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