PC Review


Reply
Thread Tools Rate Thread

Calculate cell once (on workbook open)

 
 
=?Utf-8?B?SGVuZHJpay5LbGVpbmU=?=
Guest
Posts: n/a
 
      17th Aug 2007
I have a formula that results in the date/time (NOW) a user (network name)
opens the file.

Problem is, any time a change is made this formula is updated with the most
current time. Is there any way that I can make this particular cell calculate
only on workbook open. In addidtion, can I make it calculate only if a
certain user opens the file? (user1 opens the file, cell A1 is caculated once
on opening, user2 opens the file, cell A2 is calculated once on opening but
cell A1 remains unchanged).

Thanks in advance for any feedback on this (if it's possible at all)

Hendrik
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      17th Aug 2007
Try this:-

Private Sub Workbook_Open()
usernamewindows = Environ("USERNAME")
Select Case usernamewindows
Case Is = "John"
myrange = ("A1")
Case Is = "dave"
myrange = ("A2")
Case Is = "Pete"
myrange = ("A3")
Case Else
myrange = ("A4")
End Select
Sheets("Sheet1").Range(myrange) = Date
End Sub

Mike


"Hendrik.Kleine" wrote:

> I have a formula that results in the date/time (NOW) a user (network name)
> opens the file.
>
> Problem is, any time a change is made this formula is updated with the most
> current time. Is there any way that I can make this particular cell calculate
> only on workbook open. In addidtion, can I make it calculate only if a
> certain user opens the file? (user1 opens the file, cell A1 is caculated once
> on opening, user2 opens the file, cell A2 is calculated once on opening but
> cell A1 remains unchanged).
>
> Thanks in advance for any feedback on this (if it's possible at all)
>
> Hendrik

 
Reply With Quote
 
=?Utf-8?B?cmVrbGFtbw==?=
Guest
Posts: n/a
 
      17th Aug 2007
Hi Hendrik

The formula now() is calculated anytime the sheet is calculated. You should
use an Auto_Open macro. Depending on the user opening the file you should
write:
User 1: range("A1")=now(), User 2: range("A2")=now()
This way the cells contain the actual value at starting the file and no more
a formula.

Regards
reklamo


"Hendrik.Kleine" wrote:

> I have a formula that results in the date/time (NOW) a user (network name)
> opens the file.
>
> Problem is, any time a change is made this formula is updated with the most
> current time. Is there any way that I can make this particular cell calculate
> only on workbook open. In addidtion, can I make it calculate only if a
> certain user opens the file? (user1 opens the file, cell A1 is caculated once
> on opening, user2 opens the file, cell A2 is calculated once on opening but
> cell A1 remains unchanged).
>
> Thanks in advance for any feedback on this (if it's possible at all)
>
> Hendrik

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open a specific workbook...find value from other open workbook and then insert cells values in cell next to it. amorrison2006@googlemail.com Microsoft Excel Programming 1 13th May 2007 01:46 PM
Using cell name to open workbook Orhan Microsoft Excel Programming 1 3rd Sep 2006 01:15 PM
Excel won't update/calculate a single cell in a workbook samer.kurdi@gmail.com Microsoft Excel Worksheet Functions 2 16th Dec 2005 06:39 PM
Re: Referencing a cell open a workbook Ron de Bruin Microsoft Excel Worksheet Functions 5 22nd Jul 2004 02:28 AM
How to make the opening a workbook conditional upon the value of cell in another open workbook Marcello do Guzman Microsoft Excel Programming 2 20th Mar 2004 01:56 PM


Features
 

Advertising
 

Newsgroups
 


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