Run a macro when modifying a cell

Closed
dfernandez - Jun 6, 2010 at 09:42 PM
 dfernandez - Jun 6, 2010 at 11:03 PM
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 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 6, 2010 at 10:39 PM
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
0
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?
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 6, 2010 at 10:47 PM
Are you disabling event some where ?. May be you are forgetting to turn them on again.
0
Actually no man, that is the complete code.
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 6, 2010 at 10:56 PM
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
0
Thanks sir, I will, thanks a lot for your help.
0