View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Using user form to change cell value on worksheet


Untested, so watch for typos:


Dim res As Variant
Dim myRng As Range

Set myRng = Worksheets("blending details").Range("a2:A500")

res = Application.Match(CDbl(combobox1.Text), myRng, 0)

If IsError(res) Then
MsgBox "no match!"
Else
myRng(res).Offset(0, 1).Value = textbox2.text
end if

gregork wrote:

Hi,
I have a user form with the following code for looking up a cell value on my
worksheet:

TextBox2.Text = Application.VLookup(CDbl(ComboBox1.Text), _
Worksheets("Blending Details").Range("A2:Z500"), 2, False)

Now if I was to type in a different value in text box 2 how would I write a
code that would send the updated value back to the worksheet(("Blending
Details").Range("A2:Z500"), 2,)?

Regards
gregork


--

Dave Peterson