View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Formula that knows its display location

Yes, because changing sheets does not trigger a recalculation.
That why I said you could probably use the Worksheet_Activate/Deactivate
events to call a recalc.
Worksheets("Products").Calculate

Although I feel there would be better of achieving your goal.

NickHK

"shai-hulud" wrote in message
ups.com...
Pretty much, I am trying to force an update on the Products sheet when
either of the two Location sheets become activated. Unfortunately, when
a sheet is not active, its formula's do not update, even if data
changes that would change the formula. I created the following
function:

Function ActiveSheetName()
ActiveSheetName = ActiveSheet.Name
End Function

Then, on the products table, for the products that I was having
problems with, I have the following format for the formulae


=IF(ActiveSheetName()="Location1",Location1Data,IF (ActiveSheetName()="Locati
on2",Location2Data,""))

So, when I select the Location1 sheet, the Location1Data should show,
and when I select the Location2 sheet, the Location2Data should show.
Unfortunately, because the Products sheet is not active, the formula
does not reevaluate. So, when Location1 or Location2 becomes the active
sheet, I want to force a refresh on the data on the Products sheet.

Does this clear up the problem at all?