• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 54
  • Last Modified:

Trying to Execute Macro when dropdown changes in Excel

I'm trying to have a macro run once a dropdown list has changed values but it doesn't seem to be working.
 I've tried a couple of approaches with no luck.

Thanks,

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$1" Then

Range("B2").Value = ""

End If

End Sub

Open in new window

0
mattfmiller
Asked:
mattfmiller
  • 3
  • 2
1 Solution
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Whatever you have in your code for Sheet Change Event should work if you place that code on Sheet Module.
Where have you placed that code?

To place the code on Sheet Module, right click the sheet Tab --> View Code --> Paste your code into the opened code window.
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
BTW what are you trying to achieve?
0
 
mattfmillerAuthor Commented:
Thank you very much.  I just wanted to blank the cell because I'm using a data validation indirect and the list is dependent.
0
 
mattfmillerAuthor Commented:
Thank you very much.  I'm surprised I was missing something so obvious.
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Mattfmiller! Glad your issue is resolved. :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now