Update ActiveRow from textbox excel vba -


some please - trying keep simple

i have userform updates text boxes selection in combobox. able change these populated boxes, , update command, change values in sheet , clear form

form image

sheet1 image

i've been able create userform adds data, struggle let vba select active cell , active row control box...????

once can vba correct avtivecell, can use offset , change/add needed


private sub combobox1_change()     me         .textbox1.value = sheet1.cells(.combobox1.listindex + 2, 2)         .textbox2.value = sheet1.cells(.combobox1.listindex + 2, 3)         .textbox3.value = sheet1.cells(.combobox1.listindex + 2, 4)         .textbox4.value = sheet1.cells(.combobox1.listindex + 2, 5)         .textbox5.value = sheet1.cells(.combobox1.listindex + 2, 6)         .textbox6.value = sheet1.cells(.combobox1.listindex + 2, 7)         .textbox7.value = sheet1.cells(.combobox1.listindex + 2, 8)         .textbox8.value = sheet1.cells(.combobox1.listindex + 2, 9)         .textbox9.value = sheet1.cells(.combobox1.listindex + 2, 10)     end end sub  private sub commandbutton2_click()     unload me end sub  private sub editaddbutton_click()     editadd end sub  private sub userform_initialize()     textbox1.setfocus end sub 

ok, have autopopulation done. need add code editadd click sub. presumably want replace cell values on sheet contents of in userform.

what have tried far? try reversing assignments! example, in sub, this:

private sub editaddbutton_click()     dim complaintnum integer     complaintnum = combobox1.listindex + 2     sheet1         .cells(complaintnum, 2) = textbox1.value         ' etc down list     end end sub 

i have not tested - give go , play around it. you'll need handle adding new rows, won't write yet :)


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -