LordDragon
10-01-2015, 08:32 PM
Greetings,
I'm trying to populate an ActiveX Drop List based on the values of other cells on another sheet.
I have a form that the customer fills out. This will then be entered into a copy of that form in my workbook (until I figure out how to inport it).
The problem I'm working on now though is there is a field called "Contractor" and another called "Operator". Since either one of these could be our "Customer" I have another field on a different page that specifies whom our Customer is. I have put an ActiveX Drop List in this field, which I would like to populate by using the Contractor and Operator fields from the other page.
Currently I am populating the other ActiveX Drop Lists with this code: (or something like it).
With Worksheets("System Selection").EDRBox
.AddItem "No"
.AddItem "Yes"
End With
So I tried duplicating that with this code:
'Sets the options for the drop box for Customer.
With Worksheets("System Selection").CustomerBox
.AddItem rsfContractor
.AddItem rsfOperator
End With
rsfContractor & rsfOperator were declared as Variables for the entire Module and I added a Function to find the values. I think that is where my problem is.
Function GetCustomer()
With ActiveWorkbook.Worksheets("Rig Survey Form")
rsfContractor = Range("D4:I4").Value
rsfOperator = Range("D6:I6").Value
End With
End Function
I'm pretty sure I'm just missing something simple. I would appreciate any help I can get.
I'm trying to populate an ActiveX Drop List based on the values of other cells on another sheet.
I have a form that the customer fills out. This will then be entered into a copy of that form in my workbook (until I figure out how to inport it).
The problem I'm working on now though is there is a field called "Contractor" and another called "Operator". Since either one of these could be our "Customer" I have another field on a different page that specifies whom our Customer is. I have put an ActiveX Drop List in this field, which I would like to populate by using the Contractor and Operator fields from the other page.
Currently I am populating the other ActiveX Drop Lists with this code: (or something like it).
With Worksheets("System Selection").EDRBox
.AddItem "No"
.AddItem "Yes"
End With
So I tried duplicating that with this code:
'Sets the options for the drop box for Customer.
With Worksheets("System Selection").CustomerBox
.AddItem rsfContractor
.AddItem rsfOperator
End With
rsfContractor & rsfOperator were declared as Variables for the entire Module and I added a Function to find the values. I think that is where my problem is.
Function GetCustomer()
With ActiveWorkbook.Worksheets("Rig Survey Form")
rsfContractor = Range("D4:I4").Value
rsfOperator = Range("D6:I6").Value
End With
End Function
I'm pretty sure I'm just missing something simple. I would appreciate any help I can get.