Worksheet_Change

Snowshoeken

Active Member
Joined
Aug 8, 2002
Messages
306
I am trying to use a Worksheet_Change in combo with a Drop Down Box to trigger a Macro with no success. Code as follows:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$100" Then
If Range("RegionResult").Value = "#N/A" Then
Call CommandButton1_Click
Else
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Summary").Select
Range("A3:A54").Select
Selection.AutoFilter Field:=1, Criteria1:=RegionResult
End If
End If
End Sub


Suggestions??
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Isn't one a Validation list in a cell and the other is an Object? In this case it is all about the visual. I am atempting to give the a drop down list to filter a range.
 
Upvote 0
Data Validation with a List has a dropdown.

The alternative is to assign a macro to your Drop Down (from the Forms Toolbar).
 
Upvote 0
And if I use the Validation List method I have to insert a cell for it to reside and display; which I wanted to avoid. The Drop Down that is outside of a user form does not have a VB relationship other than via Worksheet_Change; which isn't working. But I appreciate the wlaking through it help.

PS - I hate having to log in every 10 mins to Mr. Excel!
 
Upvote 0
Where is your dropdown from - Forms Toolbar or Control Toolbox? If it's from the Forms Toolbar you can right click it and assign it a macro. If it's from the Control Toolbox you can right click it (in design mode) and View Code.
 
Upvote 0
Straight from the tool box on to the worksheet, no user form. If I go to assign a macro to it, it doesn't list the worksheet_change macro, even if I remove the "Private". And it only references a "Drop Down ###" and that object haming doesn't gel with VB. I guess I could make a really small user form.
 
Upvote 0
You would need to write a macro in a General module that does what you want, then assign it to the drop down.
 
Upvote 0

Forum statistics

Threads
1,214,394
Messages
6,119,263
Members
448,881
Latest member
Faxgirl

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