Run a macro when modifying a cell [Closed]

Report
-
 dfernandez -
Hello Guys,

Maybe you can help me with this one, I am trying to run a macro when a cell changes value, the code im using is the following:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$F$7" Then

Call UnhideAllSheets

End If

End Sub

Unfortunately is not running, Ive tried to change the cell range and some times it works but most of them it doesnt, cell F7 is a dropdown menu if that is of concern.

Thanks a lot.



1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
Two things. I presume that this method was defined in the sheet where the drop down is

and other thing is that when you say dropdown, you mean the list validation dropdown and not the combo box of form. In case it is combobox from toolbox, then you need to bind it to a cell and have change method look for that bound cell
Hello, actually is the validation method, you know what is the fishy part, that sometimes when I save my work and reopen it again, it works, maybe something is wrong with the installation, what do you think?
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
Are you disabling event some where ?. May be you are forgetting to turn them on again.
Actually no man, that is the complete code.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
i meant to say in some other routine, If you could put a sample file with code at some share site like https://authentification.site , http://wikisend.com/ , http://www.editgrid.com etc and post back here the link, one might be able to give you a better answer
Thanks sir, I will, thanks a lot for your help.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!