LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default UDF, Change Event and Dropdown boxes

Dear All,

Excel 2000.

I have a UDF that looks like this (many thanks to Bob Phillips):

Function Function_Name(Code As Integer, Job As String, Country As String)
Dim sFormula As String

Application.Volatile
sFormula = "SumProduct(--(Rng1=" & Code & ")," & _
"--(Rng2=""" & Job & """)," & _
"--(Rng3=""" & Country & """), (Rng4))"
Function_Name = Evaluate(sFormula)

End Function

In several worksheets in the same workbook I have put a Worksheet Change
Event to display "Not updated". The code look like this:

Private Sub Worksheet_Change(ByVal Target As Range)
[Indicator].Value = "Not Updated"
End Sub

In the worksheets where I have the Worksheet Change Event I have dropdown
boxes (Validation - List) to ensure correct data entry.

Now... when I put Application.Volatile into the UDF, the UDF recalculates
automatically but the Worksheet Change Event is not executed when using the
dropdown boxes. Why?

If I remove Application.Volatile the Worksheet Change Event is executed
using the dropdown boxes but the UDF does not recalculate (as expected).

Talk about Catch22. Is there a piece of code I can add in the Worksheet
Change Event and/or the UDF to get them both to work properly?

Help much appreciated.
--
Regards,

Martin
 
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
Dropdown boxes (box 1 result = box 2 Greg Excel Worksheet Functions 4 August 14th 09 03:19 PM
dependent dropdown boxes Kevin M Excel Worksheet Functions 0 December 8th 05 10:51 PM
Add dropdown on an event. Chip[_3_] Excel Programming 4 March 31st 05 01:37 AM
Forms - Dropdown Boxes Olivia Excel Programming 0 November 18th 04 09:43 PM
AutoFilter Dropdown Boxes Missing Debra Dalgleish[_2_] Excel Programming 0 July 9th 03 04:19 AM


All times are GMT +1. The time now is 08:10 AM.

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"