Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 82
Default Automatic Update Upon Opening of Spreadsheet

I have a cell containing a number that I need to increase by an increment of
one each time I open the document. Is there a formula I can write that will
automatically do this for me? I am relatively new to the more advanced
capabilities of Excel, though I have a basic understanding of Visual Basic;
do I need to create a Macro or can I use a simple formula on the spreadsheet?
Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Automatic Update Upon Opening of Spreadsheet

Press Alt + F11 to open the Visual Basic Editor.
In the Project Explorer in the upper left, double-click the Thisworkbook
icon to open
the workbook module

In the module window drop down the list in the first combo-box below the
toolbars and select WORKBOOK, and then select OPEN in the combo-box to the
left.

Enter the following code, modifying the Sheet1 value to match the sheet that
will receive the update and the A1 reference to the cell that is to be
updated on open:


Dim ws As Worksheet
Dim l As Long

Set ws = ThisWorkbook.Sheets(1)

l = ws.Range("A1").Value
Range("A1").Value = l + 1
ActiveWorkbook.Save

Set ws = Nothing

Click FILE in the menu and select CLOSE AND RETURN TO EXCEL.

Save and close the workbook and reopen it to test drive.

If you don't want anyone to modify this value you might want to consider
protecting the worksheet.
--
Kevin Backmann


"Sara" wrote:

I have a cell containing a number that I need to increase by an increment of
one each time I open the document. Is there a formula I can write that will
automatically do this for me? I am relatively new to the more advanced
capabilities of Excel, though I have a basic understanding of Visual Basic;
do I need to create a Macro or can I use a simple formula on the spreadsheet?
Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 82
Default Automatic Update Upon Opening of Spreadsheet

Thank you so much! That was incredibly helpful.

"Kevin B" wrote:

Press Alt + F11 to open the Visual Basic Editor.
In the Project Explorer in the upper left, double-click the Thisworkbook
icon to open
the workbook module

In the module window drop down the list in the first combo-box below the
toolbars and select WORKBOOK, and then select OPEN in the combo-box to the
left.

Enter the following code, modifying the Sheet1 value to match the sheet that
will receive the update and the A1 reference to the cell that is to be
updated on open:


Dim ws As Worksheet
Dim l As Long

Set ws = ThisWorkbook.Sheets(1)

l = ws.Range("A1").Value
Range("A1").Value = l + 1
ActiveWorkbook.Save

Set ws = Nothing

Click FILE in the menu and select CLOSE AND RETURN TO EXCEL.

Save and close the workbook and reopen it to test drive.

If you don't want anyone to modify this value you might want to consider
protecting the worksheet.
--
Kevin Backmann


"Sara" wrote:

I have a cell containing a number that I need to increase by an increment of
one each time I open the document. Is there a formula I can write that will
automatically do this for me? I am relatively new to the more advanced
capabilities of Excel, though I have a basic understanding of Visual Basic;
do I need to create a Macro or can I use a simple formula on the spreadsheet?
Thank you.

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
Automatic update of spreadsheet & automatic update between workboo Losva Excel Worksheet Functions 6 September 12th 08 03:22 PM
automatically update a link without opening the other spreadsheet LaKaroT Excel Discussion (Misc queries) 2 May 8th 07 01:49 AM
Automatic Update Chuck Charts and Charting in Excel 1 June 9th 06 07:34 PM
Automatic update LLoraine Excel Discussion (Misc queries) 3 February 24th 06 08:57 PM
Automatic update of information in a spreadsheet aolo7276 Excel Discussion (Misc queries) 1 April 12th 05 02:39 PM


All times are GMT +1. The time now is 11:43 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"