Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
I'm coding list-type data validation in VBA depending on what I select in the type cell. Hence I have a function like this: Public Sub ChoiceTypeBox_Change() Const MakeModelCell As String = "G39" ' Update the lists under suspension when type changes If (CStr(SuspensionTypeBox.Value) = "USA") Then Call Range(MakeModelCell).Validation.Add(xlValidateList , xlValidAlertStop, xlBetween, "=USAStateList", "") ElseIf (CStr(SuspensionTypeBox.Value) = "Australia") Then Call Range(MakeModelCell).Validation.Add(xlValidateList , xlValidAlertStop, xlBetween, "=AustraliaStateList", "") End If End Sub This is suppose to update the cell with the correct list of the selected country to choose the states from. However, upon running, it always gives me a run-time error of "'1004' - Application-defined or object-defined error". I thought it may have something to do with my range so I've been trying alternatives like replacing the named list with their actual range like "=USAState!A1:A49", "=USAState!$A$1:$A$49", "='USAState'!A1:A49", etc but it's always the same. Great appreciate any suggestions or help! Thanx! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Validation - Dependent List | Excel Discussion (Misc queries) | |||
data Validation Dependent List Error | Excel Discussion (Misc queries) | |||
Dependent List (via Data Validation) Error | Excel Worksheet Functions | |||
Dependent List- Data Validation | Excel Worksheet Functions | |||
Using Validation List from Another Workbook with Dependent Data | Excel Worksheet Functions |