how to trigger a validation change

  • Thread starter Thread starter thomas donino
  • Start date Start date
T

thomas donino

I have a macro which works properly and changes the drop down list based on
what is a certain cell (H3)
The drop down list is for cell (C5).
The problems I have are;
1. Where does the code belong? a module, on the worksheet? if so under
worksheet or declarations
2. I only want this to run when some one selects cell C5 so that the proper
dropdown box is there

Ty in advance
 
Put the code in the Sheet Module and then use the Worksheet SelectionChange
option i.e

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell.Address = "$C$5" Then
'Run your code
End if

End Sub
 
I read up on it on Chip Pearson's site and I put the code in as
Worksheet Change event rather than selection change and its working fine.
Is your way better?
 
It all depends when you want the event to be triggered before or after the
cell has been edited.
The Selection Change event runs every time that you select a new cell or a
new range (so this will run your code before you edit the cell) and the
Change event runs every time that you edit a cell (so this will run after you
have edited the cell).
 
Back
Top