ZipCode UserForm

  • Hello,


    In Sheet1 A1: AP1 have names of regions. Under the name of each region (ie in A2: An) are localities in that region. Meeting is a userform that will display combobox1 regions, a combobox2 they will be displayed depending on the selected region localities in combobox1 and a textbox that will be displayed postal codes of the localities.
    Postal codes are in Sheet2. In odd-numbered columns starting with A2, C2 etc are names of localities and in even-numbered columns are postal codes of the locality.
    May be empty cells in column postal codes
    Can anyone guide me or help me with VBA code.
    Thanks in advance to all who help me.

  • Re: ZipCode UserForm


    Ingo,


    To get the most precise solution, upload a sample workbook (exact structure, dummy data) to provide the context and some content to workwith.
    Include examples of the desired results, along with a clear and explicit explanation of your requirements, logic, etc.


    You should already have the basic userform with the relevant controls created.


    If you get an upload error due to file size limitation, use ZIP compression or a file share and provide the link.

  • Re: ZipCode UserForm


    Example attached. Please note that I have altered your list structure for efficiency.


    Code used - basic, no real error handling



    ozgrid.com/forum/core/index.php?attachment/49214/

  • Re: ZipCode UserForm


    I forgot to full qualify the range for the rowsource.
    Code in previous post corrected


    Code
    1. Me.cbxCity.RowSource = rngCity.Address


    Should be


    Code
    1. Me.cbxCity.RowSource = "Lists!" & rngCity.Address