Update data in excel sheet by user form textbox and check boxes on multi rows

mkhiljee

New Member
Joined
Aug 27, 2021
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
Hi,

I am trying to create a user form with multiple text boxes and checkboxes and one Combobox, this user form is used to update request for orders, from combo box user select an item and from check user can selectthe size and from textbox, user can enter the qty, till that everything is working fine. but now I have to add the edit and update button which is not working.below is the image of my form the data need to update is available in the list box by double click on the record its populate in the textbox and combo box , I am stuck in this part.

Screenshot (7).png



this the code I am trying to work on:Private Sub CommandButton1_Click() ' Update Data

Dim L As Long
Dim th As Worksheet
Set th = ThisWorkbook.Sheets("Data")
L = Application.WorksheetFunction.Match(CLng(Me.TextBox1.Value), th.Range("A:A"), 0)
th.Range("B" & L) = Me.ComboBoxitem.Value
th.Range("D" & L).Value = Me.CheckBoxSmall.Value
th.Range("D" & L).Value = Me.CheckBoxMedium.Value
th.Range("D" & NEXTROW).Value = Me.CheckBoxLarge.Value
th.Range("D" & L).Value = Me.CheckBoXL.Value
th.Range("D" & L).Value = Me.CheckBoXXL.Value
th.Range("D" & L).Value = Me.CheckBoXXXL.Value
th.Range("E" & L).Value = Me.txtsmallqty.Value
th.Range("E" & L).Value = Me.TextBoxmedium.Value
th.Range("E" & L).Value = Me.TextBoxlarge.Value
th.Range("E" & L).Value = Me.TextBoXL.Value
th.Range("E" & L).Value = Me.TextBoxxL.Value
th.Range("E" & L).Value = Me.TextBoxxxL.Value

Me.CheckBoxSmall.Value = False
Me.CheckBoxMedium.Value = False
Me.CheckBoXL.Value = False
Me.CheckBoXXL.Value = False
Me.CheckBoXXXL.Value = False
Me.txtsmallqty.Value = ""
Me.TextBoxmedium.Value = ""
Me.TextBoxlarge.Value = ""
Me.TextBoXL.Value = ""
Me.TextBoxxL.Value = ""
Me.TextBoxxxL.Value = ""
Me.TextBox1.Value = ""

End Sub


your kind response in this regard will be highly appreciated.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,236
Messages
5,768,955
Members
425,506
Latest member
AndreaWorkPlace

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top