campB

New Member
Joined
Aug 20, 2019
Messages
2
Hello. On my userform i have 2 checkboxes (Checkbox1, Checkbox2), where the data from those checkboxes are stored in columns 11 and 12 on worksheets("Data") depending on which checkbox is selected. I have an edit button (btnEdit) which is clicked after selecting a row from a listbox (Listbox1) where the data from the selected row is then edited in the corresponding textboxes.
The problem is, i'm having trouble trying to get the checkboxes check value on the userform to be checked if the row to be edited is selected.
Below is the code I have fro the edit button. Can someone help with this?

Code:
Private Sub btnEdit_Click()
    lblID.Caption = Me.ListBox1.List(ListBox1.ListIndex)
    cboCategory.Text = Me.ListBox1.Column(1, ListBox1.ListIndex)
    cboOutlet.Text = Me.ListBox1.Column(2, ListBox1.ListIndex)
    txtRecieptNo.Text = Me.ListBox1.Column(3, ListBox1.ListIndex)
    txtAmount. Text = Me.ListBox1.Column(4, ListBox1.ListIndex)
    txtDate.Text = Me.ListBox1.Column(5, ListBox1.ListIndex)
    txtOtherInfo.Text = Me.ListBox1.Column(6, ListBox1.ListIndex)
End Sub

I kept on getting error messages when I added the checkboxes code below txtOtherInfo.Text
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,095
Messages
6,123,072
Members
449,093
Latest member
ripvw

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
Back
Top