excel - find and edit data using a form in VBA -
updated - have form shown below. form can populate list in combobox. can locate notes attached appropriate username. however, need update same cell struggling with. tried use siddharth rout's (see comments) .find code dont understand or how make apply sheets.

to populate list used following
private sub userform_activate() worksheets("notes") combobox1.list = .range("a1:a" & .range("a" & .rows.count).end(xlup).row).value end end sub since posting managed locate notes attached user name using vlookup function in vba. using code below.
sub callnotes() the_value = combobox1.text if textbox2 = "" textbox2 = "no notes applied." else textbox2 = application.worksheetfunction.vlookup(the_value, worksheets("notes").range("a:b"), 2, false) end if end sub the main problem face updating notes. comments button clicked need code username , paste contents of textbox in cell next username.
i tried vlookup failed. since deleted code , cant remember how attempted , cant back. attempted reverse whole vlookup process.
all comments , advice appreciated.
dim the_value dim the_note dim c range the_value = me.combobox1.text the_note = me.textbox2.text set c = worksheets("notes").range("a:a") _ .find(what:=the_value, lookat:=xlwhole) c.offset(columnoffset:=1).value = the_note this code comes courtesy of hans vogelaar mvp on msdn see here
still siddharth rout assistance
Comments
Post a Comment