Record macro to include changes in dropdowns
You would just write the appropriate value to the cell that contains the data
validation.
for illustration purposes, I will assume that on the activesheet, the
selection dropdown is in B9 and the Event dropdown is in C9. Then you would
use code like this.
Sub macro1
Range("B9").Value = "Selection 1"
Range("C9").Value = "Event 2"
End Sub
Sub macro2
Range("B9").Value = "Selection 2"
Range("C9").Value = "Event 1"
End Sub
an alternative approach
Sub Macro1()
Range("B9:C9").Vaue = Array("Selection 1","Event 2")
End Sub
Sub Macro2()
Range("B9:C9").Vaue = Array("Selection 2","Event 1")
End Sub
--
Regards,
Tom Ogilvy
"Graeme" wrote:
Hi,
I am a relatively new user of macros, and I am trying to write one which
changes the selection in dropdown boxes. I can create the dropdowns via Data
| Validation or the Forms toolbar. Example, the 1st dropdown contains
Selection 1 and Selection 2 as options, and the 2nd dropdown contains Event 1
and Event 2 as options. I am trying to write one macro that would change the
dropdowns to select Selection 1 and Event 2, and another macro that would
change the dropdowns to show Selection 2 and Event 1. Thank you for the help.
Graeme
|