Running a Macro based on Forms Combo Box

mtampa

Board Regular
Joined
Oct 15, 2007
Messages
61
Hi Guys,

I have a forms combo box that outputs to cell K3. When item 3 is selected and the value in cell K3 = 3, I want my macro called EMPVILL to run. However, it only fires when I type a 3 in the box and hit enter. As of now, when I change the value of the combo box to 1, 2, 3 or 4, nothing happens, it just sits there.

Here is the code I'm using:

rivate Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = 3: Call EMPVILL
Case Else: 'Do Nothing
End Select
End If
End Sub

Can someone point me in the right direction to make it fire when cell K3 changes to the value of 3?

Thanks,

Mike
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Yes I did. Would I be able to send it to you for a quick look if it's not too much of a bother?

If you want to upload it to a file share site and post a link, I'll take a look.

Or just post all your code for the Test_K2 and EMPVILL macros
 
Upvote 0
I can't upload to any share sites at work, but here are th codes:

Sub EMPVILL()
'
' EMPVILL Macro
' Macro recorded 10/11/2011 by tampami
'

'
ActiveSheet.Shapes("Drop Down 96").Select
Selection.ShapeRange.IncrementLeft -527.25
Selection.ShapeRange.IncrementTop 3#
End Sub


And


Sub Test_K3()
If Range("K3").Value = 3 Then Call EMPVILL
End Sub
 
Upvote 0
Can you double check that you assigned the Test_K3 macro to the combobox and not the EMPVILL macro?
 
Upvote 0
That would be it!!!!!!!!!

AlphaFrog - thank you very much for your patience and help. I really can't thank you enough!
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,472
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top