+ Reply to Thread
Results 1 to 7 of 7

Fill a cell via textbox according to combobox selection

  1. #1
    Registered User
    Join Date
    07-22-2013
    Location
    Germany
    MS-Off Ver
    Excel 2003, 2010
    Posts
    21

    Fill a cell via textbox according to combobox selection

    Hi everyone,

    Pb 1: I have a userform with 1 combobox and 2 textbox. (The combo box is populated with a dynamic range). I would like to be able to select an option from the combobox and when I click the command button the info in the textbox will be placed into the sheet in the same row as the selected combobox word. For example. The combo box has a list of months-year, I want to select a "Jun-12", enter info into textbox1 and tectbox2, click the button "enter" and have the info placed into a cell on the column belongs to the month. ("Jun-12" on cell D27, so text1 on the cell D28 and text2 on the cell D29)


    Pb 2 : Textbox6 -> it belongs to comments, but if there is already a comment on the sheet "interne Supplier PPM". For a new comment, i want to insert a new range in order to write the new one and the older one goes below to the new one.


    Any help would be appreciated
    Attached Files Attached Files

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Fill a cell via textbox according to combobox selection

    You'll have to change userform objects in this code to the names you have in your userform but try:

    Please Login or Register  to view this content.
    On the second problem, you want to search the entire worksheet for that one comment? Can you narrow down the possible ranges?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    07-22-2013
    Location
    Germany
    MS-Off Ver
    Excel 2003, 2010
    Posts
    21

    Re: Fill a cell via textbox according to combobox selection

    Thanks for ur prgm, but i got a small issue:

    My pb is Combobox should take the values from these range("C26:F26"). First issue, he shows only the value from C26. the second issue is :in your prgm, you select Col "D" & l. but what i want is tht it should select C26 or D26 or E26 or F26.
    Please Login or Register  to view this content.

    Pb 2: Comments are located in the range("V11:AA30"). so the range is limited.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Fill a cell via textbox according to combobox selection

    Change this:
    Please Login or Register  to view this content.
    To:
    Please Login or Register  to view this content.
    click the button "enter" and have the info placed into a cell on the column belongs to the month. ("Jun-12" on cell D27, so text1 on the cell D28 and text2 on the cell D29)
    Where exactly will months you are searching for be? And what cells would you like updated by the textboxes if its found?

  5. #5
    Registered User
    Join Date
    07-22-2013
    Location
    Germany
    MS-Off Ver
    Excel 2003, 2010
    Posts
    21

    Re: Fill a cell via textbox according to combobox selection

    Thanks Xero Solus for ur solution, but i came back to my initial pb:
    Once the month is selected by the ComboBox4 (if month belongs to cell D26), I want to copy the data from TextBox4 to cell D27 and from Textbox5 to Cell D28.

    CHeck the pgm part 'Last evolution' (not working)
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-22-2013
    Location
    Germany
    MS-Off Ver
    Excel 2003, 2010
    Posts
    21

    Re: Fill a cell via textbox according to combobox selection

    But my second issues has been solved, thank you for that!

    Please Login or Register  to view this content.

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Fill a cell via textbox according to combobox selection

    I don't understand what the problem is. The 'last evolution' block of code will copy to D27, and D28 if the combobox value matches D26.

+ 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. [SOLVED] Fill a cell via textbox on userform depending on combobox selection
    By Rhamilton2512 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2012, 10:29 AM
  2. [SOLVED] Use combobox to fill textbox within userform
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-26-2012, 03:39 PM
  3. Combobox to fill textbox with one of 3 choices
    By nighttrainrex in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-20-2012, 02:24 AM
  4. Filling Textbox based on Combobox selection
    By Borg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2009, 02:55 AM
  5. [SOLVED] A Simply ComboBox Selection returns value to TextBox
    By thom hoyle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2005, 08:05 PM

Tags for this Thread

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