![]() |
Using user form to change cell value on worksheet
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 |
Using user form to change cell value on worksheet
Dim rng as range, res as Variant, rng1 as Range
Set rng = Worksheets("Blending Details").Range("A2:A500") res = Application.Match(cDbl(combobox1.Text),rng,0) if not iserror(res) then set rng1 = rng(res) rng1.offset(0,1).Value = Textbox2.Text Else msgbox "No Match for " & Combobox1.Text End if -- Regards, Tom Ogilvy "gregork" wrote in message ... 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 |
Using user form to change cell value on worksheet
Many thanks guys that was exactly what I was looking for.
Kind Regards gregork "gregork" wrote in message ... 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 |
All times are GMT +1. The time now is 01:42 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com