+ Reply to Thread
Results 1 to 10 of 10

Get cells value in textbox according to combobox slection in simple way

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Get cells value in textbox according to combobox slection in simple way

    hi, everyone

    i am using below code to get cells value in textboxes according to combobox1 selection

    Please Login or Register  to view this content.

    i have 125 textboxes here and my offset is till 126

    like
    TextBox3 = bul.Offset(i, 4) to,,,,TextBox125 = bul.Offset(i, 126)

    i want to do this process in simple way..

    thanx a lot
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Get cells value in textbox according to combobox slection in simple way

    Hi,

    I assume your code is in part of the userform? How about:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Get cells value in textbox according to combobox slection in simple way

    Loop through the textboxes, this example assumes there are 4 textboxes with the name TextBox1,TextBox2, ect:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Re: Get cells value in textbox according to combobox slection in simple way

    Thanx a lot for reply both of you

    I will try tomorrow morning...

  5. #5
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Re: Get cells value in textbox according to combobox slection in simple way

    @Arkadi

    Wroking as i wanted

    thanx a ton to you

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,363

    Re: Get cells value in textbox according to combobox slection in simple way

    And how about this
    Please Login or Register  to view this content.
    to this

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Get cells value in textbox according to combobox slection in simple way

    Why do you need to empty the textboxes before you populate them?

  8. #8
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Re: Get cells value in textbox according to combobox slection in simple way

    hello, davesexcel
    Because every time i need to change the data of textboxes after pass data to worksheet?

  9. #9
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Re: Get cells value in textbox according to combobox slection in simple way

    hello, davesexcel
    Because every time i need to change the data of textboxes after pass data to worksheet?

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Get cells value in textbox according to combobox slection in simple way

    Okay, but the code you are using is clearing the textboxes and populating them again. The code doesn't care if the textbox is empty or not, it is going to change the value regardless.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 08-18-2015, 04:13 PM
  2. Changing value to cells from combobox choise with textbox
    By coyotenorth in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2014, 07:45 PM
  3. Userform - selecting data for combobox 2 basedon slection in combobox 1
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2013, 04:27 PM
  4. input the value of a Combobox and a textbox to a TEXTBOX directly from a userform
    By Gordonhk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2013, 03:25 PM
  5. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM
  6. [SOLVED] UserForm TextBox and ComboBox selections populate SPECIFIC spreadsheet cells
    By ZIXILPLIX in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-23-2010, 02:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1