Hi everyone,
I'm designing a userform that uses multiple checkboxes based on shoe sizes.
So the user has to fill in the textboxes and then clicking on the checkboxes for the size will populate a line for each size with all the details.
The problem I'm having is that when I untick a size it only removes the previous line (A place holder because I don't know how to implement the way I want) rather than the line associated with the size, is this even possible?
Also when I reset all the fields on the userform it will display my warning for every checkbox cleared, I have tried putting in
just after my ''start note but it doesn't seem to be effective.
Thank you for taking the time to look at the post
I have included the code from one of the check box clicks:
I'm designing a userform that uses multiple checkboxes based on shoe sizes.
So the user has to fill in the textboxes and then clicking on the checkboxes for the size will populate a line for each size with all the details.
The problem I'm having is that when I untick a size it only removes the previous line (A place holder because I don't know how to implement the way I want) rather than the line associated with the size, is this even possible?
Also when I reset all the fields on the userform it will display my warning for every checkbox cleared, I have tried putting in
VBA Code:
If ME.CheckBox95k=True Then
Thank you for taking the time to look at the post
I have included the code from one of the check box clicks:
VBA Code:
Private Sub CheckBox10_Click()
'''Input
Dim ws As Worksheet
Dim LastRow As Long, RowInsert As Long
Set ws = ThisWorkbook.Worksheets("stock")
With ws
LastRow = .Cells(Rows.Count, "A").End(xlUp).row
RowInsert = .Range("A1:A" & LastRow).Find("*", .Cells(LastRow, "A"), xlValues, , , xlPrevious).row
RowInsert = RowInsert + 1
RowInvert = RowInsert - 1
'add the uk size input code here
'''Checkbox based search
''Start
If Me.comboboxbrand.Value = "" Then
MsgBox "please enter a brand", vbInformation
Exit Sub
End If
If Me.comboboxgender.Value = "" Then
MsgBox "please enter an item gender", vbInformation
Exit Sub
End If
If Me.comboboxclosure.Value = "" Then
MsgBox "please enter a closure type", vbInformation
Exit Sub
End If
If Me.comboboxmaterial.Value = "" Then
MsgBox "please enter an upper material type", vbInformation
Exit Sub
End If
'If Me.comboboxuksize.Value = "" Then
'MsgBox "please enter the uk size", vbInformation
'Exit Sub
'End If
If Me.comboboxmodel.Value = "" Then
MsgBox "please enter a model type", vbInformation
ElseIf Me.CheckBox10.Value = True Then
''''This has to match the number of rows input below
.Cells(RowInsert, "A").Resize(1, 8).Value = Array( _
Me.txtDate.Text, _
Me.textboxparentsku.Text, _
Me.comboboxbrand.Text, _
Me.comboboxclosure.Text, _
Me.comboboxgender.Text, _
Me.comboboxmaterial.Text, _
Me.comboboxmodel.Text, _
Me.ComboBoxcolour.Text _
)
ws.Range("I" & RowInsert).Value = CheckBox10.Caption
ElseIf Me.CheckBox10.Value = False Then .Cells(RowInvert, "A").Resize(1, 9).Value = ""
End If
''Finish
Set ws = Nothing
End With
End Sub