Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8192709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:14:19+00:00 2026-06-07T04:14:19+00:00

i have experience in programing, however, I am new to VBA. I have a

  • 0

i have experience in programing, however, I am new to VBA. I have a user form that i am working on. This form has a Combo Box that has a list initialized to it. What i am trying to do is:

*Get the ID Number value inputted by the user from the ComboBox
*Take the value inputted by the user and find its match using a range of values from a worksheet (i.e. Worksheet.Range(“ID_Number_List”))
*Once it obtains it’s match get the location of the cell that it matches
* Off set the location of the cell by one column to get the Name that relates to the ID Number(Same Row) to set it to textBoxName.Value
*Off set it two columns to get the telefone number that relates to the ID Number and set it to textboxTele.value

I want this to happen as soon as a value is selected from the Combobox, so my question is does my code go in the combo box or does it go to the next text box? so as soon as the person tabs over to the next text box the code is automatically execute. i would like the code to fully execute without tabing over to the next box.

This code is not complete but here is what i have (i didnt add the off set part i just did a test execution):

Dim ORIValue As String 
'get value from combo_box Set 
ORIValue = COMBO_ORILIST.Value

Dim cLoc As Range 
Dim cORIVal As Range

'worksheet with the ID information Dim ORISheetList As Worksheet 
Set ORISheetList = Worksheets("ORI_LIST")

'
For Each cLoc In ORISheetList.Range("ORI_LIST")
'compare the input string from list- considering using Match function for this
If StrComp(cLoc, ORIValue,  vbTextCompare) Then TextBAgencyName.Value = "test"
Else: Next cLoc
End If

Let me know what you think. If i have to rewrite everything i will.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:14:20+00:00Added an answer on June 7, 2026 at 4:14 am

    Your code doesn’t compile.

    If you have a userform with a single combobox called ComboBox1, you need to put your cell-finding code in the form code as follows:

    Private Sub ComboBox1_Change()
        MsgBox "yep, this is where the code should go"
    End Sub
    

    I suspect using the rowsource property of the combobox in combination with the index of the selected value you probably don’t need to actually perform a search for the selected value. Something like this might work:

    Private Sub ComboBox1_Change()
        MsgBox Range(ComboBox1.RowSource).Cells(ComboBox1.ListIndex + 1)
    End Sub
    

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Introduction : I have prior experience in programming (C, C++, Java), however, this is
I have no experience with low level programing and I need this piece of
I am new to VBA but have previous experience with PHP programming logic and
I'm new to Android programming however I do have some Java experience. What I
i am very new to programming in java however have a lot of experience
I'm new to HTML; however I have programming experience with Objective-C, here's my code:
I'm new to C# and don't have any programming experience. But I've finish a
I'm just starting to learn Javascript; I do however have experience in programming using
Disclaimer: I am new to python and django but have Drupal programming experience. I'm
Disclaimer: I am new to python and django but have experience programming in Drupal.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.