PC Review


Reply
Thread Tools Rate Thread

Combo Box Trigger for Macro using Worksheet_SelectionChange

 
 
Frank Hayes
Guest
Posts: n/a
 
      18th Mar 2007
I am attempting to trigger a macro ("Macro1") whenever the results of a
Combo Box change. I do not want to use Worksheet_Calculate() because I
wind up in an endless loop due to other design constraints on the worksheet.
The ComboBox uses cell B2 as the linked cell for the result. I have tried
the following code without success:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B2")) Is Nothing Then
Macro1
End If
End Sub

I have also tried setting cell B1 to "=B2" and then triggering on the change
of B1, but that has also failed. Can anyone give some guidance on how I
might trigger the macro other than through Worksheet_Calculate() ?

I am using Excel 2000 SP-3

Thank you,

Frank Hayes


 
Reply With Quote
 
 
 
 
mvanwaas@gmail.com
Guest
Posts: n/a
 
      18th Mar 2007
Is there some reason you're not using the much more direct
ComboBox*_Change() event? It's available for the ComboBox accessible
in the Control Toolbox Toolbar and is designed for exactly what I
think you're looking for.

/ Tyla /


On Mar 18, 7:43 am, "Frank Hayes" <haye...@verizon.net> wrote:
> I am attempting to trigger a macro ("Macro1") whenever the results of a
> Combo Box change. I do not want to use Worksheet_Calculate() because I
> wind up in an endless loop due to other design constraints on the worksheet.
> The ComboBox uses cell B2 as the linked cell for the result. I have tried
> the following code without success:
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> If Not Intersect(Target, Range("B2")) Is Nothing Then
> Macro1
> End If
> End Sub
>
> I have also tried setting cell B1 to "=B2" and then triggering on the change
> of B1, but that has also failed. Can anyone give some guidance on how I
> might trigger the macro other than through Worksheet_Calculate() ?
>
> I am using Excel 2000 SP-3
>
> Thank you,
>
> Frank Hayes



 
Reply With Quote
 
Frank Hayes
Guest
Posts: n/a
 
      18th Mar 2007
Worked great. Thank you. I just didn't know it was there!

Frank

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there some reason you're not using the much more direct
> ComboBox*_Change() event? It's available for the ComboBox accessible
> in the Control Toolbox Toolbar and is designed for exactly what I
> think you're looking for.
>
> / Tyla /
>
>
> On Mar 18, 7:43 am, "Frank Hayes" <haye...@verizon.net> wrote:
>> I am attempting to trigger a macro ("Macro1") whenever the results of a
>> Combo Box change. I do not want to use Worksheet_Calculate() because I
>> wind up in an endless loop due to other design constraints on the
>> worksheet.
>> The ComboBox uses cell B2 as the linked cell for the result. I have
>> tried
>> the following code without success:
>>
>> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>> If Not Intersect(Target, Range("B2")) Is Nothing Then
>> Macro1
>> End If
>> End Sub
>>
>> I have also tried setting cell B1 to "=B2" and then triggering on the
>> change
>> of B1, but that has also failed. Can anyone give some guidance on how I
>> might trigger the macro other than through Worksheet_Calculate() ?
>>
>> I am using Excel 2000 SP-3
>>
>> Thank you,
>>
>> Frank Hayes

>
>



 
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
Make second combo column trigger event CJ Microsoft Access Form Coding 2 13th Nov 2007 09:22 PM
Cannot trigger OnChange event from inspector's command bar combo box tonyl Microsoft Outlook Program Addins 0 10th Oct 2006 08:23 AM
Combo used for Find does not trigger AfterUpdate Event Pat Garard Microsoft Access 3 14th Jun 2005 06:43 AM
Trigger a Macro in MS Access from an Excel Macro? =?Utf-8?B?RG9uUmV0ZA==?= Microsoft Excel Programming 15 30th Mar 2005 09:52 PM
Adding Worksheet_SelectionChange code by macro Alan Webb Microsoft Excel Programming 2 19th May 2004 10:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:51 PM.