Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27208

creating data validation list from vba & display the dependent description in msgbox

$
0
0
i have Countrylist in column X and its capital in column Y . the country & city list is populated in the sheet from database

i am creating a data validation list dropdown in cell K9
Code:

rList = "=Sheet1!$X$1:$X$10"

    With Sheet1.Range("K9:K9")
        With .Validation
        .Delete
        .Add xlValidateList, xlValidAlertStop, xlBetween, "=" & rList
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True
        End With
    End With

wht i need is whtever data item is selected from the list its corresponding capital shld be displayed in mgsbox
i need it from VBA

Viewing all articles
Browse latest Browse all 27208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>