i have a excl workbook with sheet1 & mastersheet
in Master sheet i have defined values in list Column D & F
Column D has COUNTRY as heading and country Names below it
Column F has CITY and city list
Im column A i have 2 data list
as
COUNTRY
CITY
i have dropdown in excel sheet (SHEET1) in Column K populated with data from MASTER in Column A ie city & country
When i select city i need Dropdown in column L to be populated with Citylist from MASTERS COLUMN F and if city seleced i need to get data from column D
but i get type mismatch error
in Master sheet i have defined values in list Column D & F
Column D has COUNTRY as heading and country Names below it
Column F has CITY and city list
Im column A i have 2 data list
as
COUNTRY
CITY
i have dropdown in excel sheet (SHEET1) in Column K populated with data from MASTER in Column A ie city & country
When i select city i need Dropdown in column L to be populated with Citylist from MASTERS COLUMN F and if city seleced i need to get data from column D
but i get type mismatch error
Code:
Set wsLists = Worksheets("MasterSheet")
With Target
If Target.Value = "COUNTRY" Then
PartNoRow = Application.Match(.Value, wsLists.Range("COUNTRY"), 0)
.Offset(0, 1).Value = wsLists.Range("CST")(PartNoRow).Value
ElseIf Target.Value = "CITY" Then
PartNoRow = Application.Match(.Value, wsLists.Range("CITY"), 0)
.Offset(0, 1).Value = wsLists.Range("CITY")(PartNoRow).Value
End If
End With
Last edited: