GiraffetheGeek
Board Regular
- Joined
- May 25, 2011
- Messages
- 58
Hi there,
I am new to programming excel with VBA, slowly picking up on things but I must be having a blonde moment at the moment.
I have two combobox's, RCComboBox and SDComboBox.
Also Cells AI46 to AI58 are number 1-13 and then the cells beside each one have two dates. i.e AI46 is 1 and then AJ46 is date1 and AK46 is date2 etc.
RCComboBox has it's ListFillRange set as AI46:AI58 (users can only pick 1-13)
I want SDComboBox's ListFillRange to be set to the range of the two cells beside based on the value in RCComboBox. ie if the user selects 2 in RCComboBox then SDComboBox's ListFillRange should be AJ47:AK47.
I have started with:
Private Sub RCComboBox_Change()
If RCComcoBox.Value = 1 Then SDComboBox.ListFillRange = AJ46:AK46
If RCComcoBox.Value = 2 Then SDComboBox.ListFillRange = AJ47:AK47
etc.
But it doesn't seem to work and I am now stumped.
Any ideas would be greatly appreciated.
I am new to programming excel with VBA, slowly picking up on things but I must be having a blonde moment at the moment.
I have two combobox's, RCComboBox and SDComboBox.
Also Cells AI46 to AI58 are number 1-13 and then the cells beside each one have two dates. i.e AI46 is 1 and then AJ46 is date1 and AK46 is date2 etc.
RCComboBox has it's ListFillRange set as AI46:AI58 (users can only pick 1-13)
I want SDComboBox's ListFillRange to be set to the range of the two cells beside based on the value in RCComboBox. ie if the user selects 2 in RCComboBox then SDComboBox's ListFillRange should be AJ47:AK47.
I have started with:
Private Sub RCComboBox_Change()
If RCComcoBox.Value = 1 Then SDComboBox.ListFillRange = AJ46:AK46
If RCComcoBox.Value = 2 Then SDComboBox.ListFillRange = AJ47:AK47
etc.
But it doesn't seem to work and I am now stumped.
Any ideas would be greatly appreciated.