Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a userform with a combobox and some textboxes. The combobox gets its list from a range of rows in one of the sheets. The user selects a value in the combobox, and can fill the other textfields. When the user presses the OK button in the form, I want the values of the textboxes to be put to specific columns on the row corresponding to the row that is selected in the combobox. Please help me how to solve this! I should also mention that the range is dynamic, so it its resized with another row (eg from A1:A50 to A1:A51). The problem is to have values placed in eg B15 and C15 if the user selects the value from A15 in the combobox. Hope for help :-) NorTor |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like this:
Code ------------------- Sub CommandButton_Click() dim r as Range For Each r in Range("A1:A" & Range("A65536").End(xlUp).Row If r.Value = Combo1.Text Then Range("B" & r.Row).Value = Text1.Text Range("C" & r.Row).Value = Text2.Text Exit For End If Next End Su ------------------- It basically searches the A column until it finds the same thin selected in the combobox, then puts the text box values into columns and C of the same row. -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you so much for you reply, I will try it right away :)
Regards NorTor On Thu, 1 Jul 2004 12:26:44 -0500, kkknie wrote: Try something like this: Code: -------------------- Sub CommandButton_Click() dim r as Range For Each r in Range("A1:A" & Range("A65536").End(xlUp).Row If r.Value = Combo1.Text Then Range("B" & r.Row).Value = Text1.Text Range("C" & r.Row).Value = Text2.Text Exit For End If Next End Sub -------------------- It basically searches the A column until it finds the same thing selected in the combobox, then puts the text box values into columns B and C of the same row. K --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
Not allowing to continu unless a specific cell has specific answer | Excel Discussion (Misc queries) | |||
Link to specific cell in specific Excel file | Excel Discussion (Misc queries) | |||
Link from a specific Cell in Excel to a specific para. in Word | Excel Worksheet Functions | |||
Highlight a row if a specific cell is specific numbers/words | Excel Worksheet Functions |