If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Refresh Cells upon opening Excel file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-14-04, 22:56
oks oks is offline
Registered User
 
Join Date: Jun 2004
Location: Singapore
Posts: 28
Question Refresh Cells upon opening Excel file

Hi all,

I had an Excel file with a few cells using some User defined functions that I had wrote. But I does not seems to recalculate when ever I open this Excel file. Can anyone please advise on what I can do so that these cells will auto refresh the calculation.

Thanks alot.
oks
Reply With Quote
  #2 (permalink)  
Old 12-15-04, 00:17
jparagg jparagg is offline
Registered User
 
Join Date: Oct 2003
Posts: 17
Hi,

Check whether by chance in the options menu recalculation is set to manual instead of automatic.
Otherwise send a dummy parameter to the function with reference to the cell that is changed. You may ignore this parameter in your function, but while callin the function on the cell, the parameter should be passed. For example if you are expecting some change in some value in some cell when value in A10 changes, you can pass an argument to the function as A10.
i.e. your function for example may be like

Public Function myfunc() As Integer
'just double the value of A10 and place it wherever the function is called
myfunc = Sheet1.Cells(10, 1) * 2
End Function

You may have put in your some cell =myfunc()
This will not be refreshed automatically even if the value in A10 changes.

For this you may change the function to

Public Function myfunc(dummy As Range) As Integer
myfunc = Sheet1.Cells(10, 1) * 2
End Function

And wherever your are putting the function as =myfunc() put it as =myfunc(A10)

HTH

jp
Reply With Quote
  #3 (permalink)  
Old 12-15-04, 09:08
MikeTheBike MikeTheBike is offline
Registered User
 
Join Date: Apr 2004
Location: Derbyshire, UK
Posts: 714
Hi

Although I have not tried it, but, would putting 'Application.Calculate' in the Workbook objects Workbook_Open() event update the worksheet when it opens??

MTB
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On