Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Forcing a function to calculate

What is the syntax to force a function to calculate from another sheet?

Function Test()

End Function

Worksheets("Sheet1").Test.Calculate

This won't work, but I think I am getting close.

Thanks in advance.

Floyd

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Forcing a function to calculate

Worksheets("Sheet1").Calculate

If you want to force an individual cell to calculate and Excel doesn't think
it needs to be calculatee

With worksheets("Sheet1").Range("B9")
.Formula = .Formula
End with

would be one way if the formula is in B9 of sheet1.

--
Regards,
Tom Ogilvy

"Floyd" wrote in message
oups.com...
What is the syntax to force a function to calculate from another sheet?

Function Test()

End Function

Worksheets("Sheet1").Test.Calculate

This won't work, but I think I am getting close.

Thanks in advance.

Floyd



  #3   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Forcing a function to calculate

are you talking about you want to calculate that worksheet or you want to run
that function from VBA?
ben

"Floyd" wrote:

What is the syntax to force a function to calculate from another sheet?

Function Test()

End Function

Worksheets("Sheet1").Test.Calculate

This won't work, but I think I am getting close.

Thanks in advance.

Floyd


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Forcing a function to calculate


"Floyd" wrote in message
oups.com...
What is the syntax to force a function to calculate from another sheet?

Function Test()

End Function

Worksheets("Sheet1").Test.Calculate

This won't work, but I think I am getting close.

Thanks in advance.

Floyd



Test is a user defined function, right? You only need to add one line of
code to the function, like this:

Function Test()
Application.Volatile True
End function

"Test" will now be recalculated whenever the sheet is reaclculated.

/Fredrik



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Forcing a function to calculate

All:

I have never seen anything like this.

I have all of the following commands in the function:
Application.Volatile True
Application.Calculate
Application.Calculation = xlCalculationAutomatic

I have verified that the function will compile and that
Tools-Options-Calculation-Automatic is setup.

I have tried the code segment suggested by Mr. Ogilvy in this post and
still none of this works.

The only thing that works is to open Sheet1 and hit F9. Only then will
it calculate the function.

I spent the weekend reading/searching this group's archives. Although
I found quite a bit of interesting material, I did not find a solution.

Could this be a bug in Excel?

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
cant calculate sum function Neeraj Paul Excel Discussion (Misc queries) 9 May 31st 09 06:09 PM
Calculate function Xx+1=rX(1-X). How? Kanon Excel Discussion (Misc queries) 2 March 19th 07 08:01 PM
function doesn't calculate [email protected] Excel Worksheet Functions 3 December 18th 06 04:26 AM
Function Won't Calculate -- Sometimes Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 4 April 13th 05 04:38 PM
How to calculate PMT function Daniel Excel Worksheet Functions 1 November 18th 04 08:42 PM


All times are GMT +1. The time now is 07:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"