Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Incrementing by 1 when doc is opened
I am trying to increment a number by one every time the document is opened -
will I need to make a macro? I am new with macros and know not much about them. Please can someone help - the original document is in word, but I'm not sure if you can increment in word - it would be good if I could though - I would rather use word then excel but if can't be done, excel will have to do. Thanks Jenner |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Incrementing by 1 when doc is opened
I believe you will have to use a macro like this...
Private Sub Workbook_Open() Range("A1").Formula = Range("A1").Value + 1 ActiveWorkbook.Save End Sub Insert this code under "ThisWorkbook". You will need to change the A1 to the desired cell you want incremented. The "ActiveWorkbook.Save" may not be necessary, depending on what you want. If someone opened the file and didn't save, it would not record the change without that command. "Jenner" wrote: I am trying to increment a number by one every time the document is opened - will I need to make a macro? I am new with macros and know not much about them. Please can someone help - the original document is in word, but I'm not sure if you can increment in word - it would be good if I could though - I would rather use word then excel but if can't be done, excel will have to do. Thanks Jenner |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Incrementing by 1 when doc is opened
Thanks for your help - I will try that.
"Sloth" wrote: I believe you will have to use a macro like this... Private Sub Workbook_Open() Range("A1").Formula = Range("A1").Value + 1 ActiveWorkbook.Save End Sub Insert this code under "ThisWorkbook". You will need to change the A1 to the desired cell you want incremented. The "ActiveWorkbook.Save" may not be necessary, depending on what you want. If someone opened the file and didn't save, it would not record the change without that command. "Jenner" wrote: I am trying to increment a number by one every time the document is opened - will I need to make a macro? I am new with macros and know not much about them. Please can someone help - the original document is in word, but I'm not sure if you can increment in word - it would be good if I could though - I would rather use word then excel but if can't be done, excel will have to do. Thanks Jenner |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Incrementing by 1 when doc is opened
Hi,
Do you know if you can increment in word? Do I put the same macro in as below? thanks Jenner "Sloth" wrote: I believe you will have to use a macro like this... Private Sub Workbook_Open() Range("A1").Formula = Range("A1").Value + 1 ActiveWorkbook.Save End Sub Insert this code under "ThisWorkbook". You will need to change the A1 to the desired cell you want incremented. The "ActiveWorkbook.Save" may not be necessary, depending on what you want. If someone opened the file and didn't save, it would not record the change without that command. "Jenner" wrote: I am trying to increment a number by one every time the document is opened - will I need to make a macro? I am new with macros and know not much about them. Please can someone help - the original document is in word, but I'm not sure if you can increment in word - it would be good if I could though - I would rather use word then excel but if can't be done, excel will have to do. Thanks Jenner |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I find an Excel spreadsheet opened as attachment in Outlook | Excel Discussion (Misc queries) | |||
file opened twice on network | Excel Discussion (Misc queries) | |||
pane freezes when file is opened | Excel Discussion (Misc queries) | |||
Link Soucre changes when Spreadsheet opened from with within Outlook | Links and Linking in Excel | |||
can't save newly opened files | Excel Discussion (Misc queries) |