LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Dependent List in Data Validation: Runtime Error

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation - Dependent List Prasad Gopinath Excel Discussion (Misc queries) 1 June 29th 08 10:08 PM
data Validation Dependent List Error Marilyn Excel Discussion (Misc queries) 2 February 5th 08 06:05 PM
Dependent List (via Data Validation) Error Dezdan Excel Worksheet Functions 2 December 2nd 05 12:33 AM
Dependent List- Data Validation Annie Excel Worksheet Functions 2 September 23rd 05 03:40 PM
Using Validation List from Another Workbook with Dependent Data Mike R. Excel Worksheet Functions 5 January 8th 05 07:06 PM


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"