textbox

  • Thread starter Thread starter Aksel Børve
  • Start date Start date
A

Aksel Børve

I made a UserForm With a Combobox and a Textbox. The Combobox have the
rowsource A1:106. How can I make the Textbox display the value that is in
the cell 6 column to the right for the cell I selected with the combobox. Is
it possible to set a new value in the cell using the textbox?



Thanks

Aksel Børve
 
Aksel

I have the values a,b,c,d,e,f in cells A1:A6 and
1,2,3,4,5,6 in C1:C6.

In the code for the combobox I have the following
Private Sub ComboBox1_Change()
TextBox1.Text = WorksheetFunction.VLookup(ComboBox1, Range
("a1:c6"), 3, False)
End Sub

When a change is made to the selection in the combobox,
the text in the textbox updates.

This should get you started.

Tony
 
Hi Aksel,

Add this code to the combobox click event

Private Sub ComboBox1_Click()
With ComboBox1
Me.TextBox1.Text = Worksheets("Sheet1").Range(.RowSource)(1, 1). _
Offset(.ListIndex, 6).Value
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top