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??
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Snowshoeken

Active Member
Joined
Aug 8, 2002
Messages
306

ADVERTISEMENT

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.
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Data Validation with a List has a dropdown.

The alternative is to assign a macro to your Drop Down (from the Forms Toolbar).
 

Snowshoeken

Active Member
Joined
Aug 8, 2002
Messages
306

ADVERTISEMENT

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!
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
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.
 

Snowshoeken

Active Member
Joined
Aug 8, 2002
Messages
306
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.
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
You would need to write a macro in a General module that does what you want, then assign it to the drop down.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,766
Messages
5,513,296
Members
408,944
Latest member
jholly1984

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top