Olwa
05-11-2017, 04:07 AM
Hi there,
im currently using Excel 2013 and i got 2 problems with my code:
1. Updating UserForm
Lets say I got a ComboBox in which u can choose a certain circle of friends (eg school, university, job, sports). After that you can choose a name within a ListBox. Depending on the name certain criteria (just Labels, eg male?) are marked with "x" or "" using TextBoxes for Yes and No
(eg tobi -> male? [x] Yes [ ] No, Tina -> male? [ ] Yes [x] No) depending on the entry in a sheet ive set before. Now this works back and forth, thus allowing me to change criteria (eg gender change). Additionaly i got a CommandButton allowing me to set new entries in the last row and setting "x" and "" whereever it is needed. The sheet now show the correct data, the UserForm however does not show a new circle of friends that is actually in the sheet by now. If i restart however it shows in the ComboBox. Any suggestions? Im initially not going to post parts of the code as everything works fine and im only looking for additional functionality.
2. TextBox DblClick
As mentioned above i got 2 TextBoxes to fill with an "x" or not ( i did not use ControlBoxes as there does not seem to been any way to alter the size of the actual Box). As its "too much work" to type an "x" i would like it to be shown as i double blick the box. This does not seem to work though.. Any suggestions in this matter? Wouldnt mind trying a completely different approach either. Heres the code:
Private Sub TextBox1_DblClick()
Dim lindex As Long
If ListBox1.ListIndex >= 0 Then
lindex = 2
Do While Trim(CStr(Sheets(1).Cells(lindex, 1).Value)) <> ""
If ListBox1.Text = Trim(CStr(Sheets(1).Cells(lindex, 3).Value)) Then
Sheets(1).Cells(lindex, 4).Value = "x"
Exit Do
End If
lindex = lindex + 1
Loop
End If
End SubThank you guys in advance!
im currently using Excel 2013 and i got 2 problems with my code:
1. Updating UserForm
Lets say I got a ComboBox in which u can choose a certain circle of friends (eg school, university, job, sports). After that you can choose a name within a ListBox. Depending on the name certain criteria (just Labels, eg male?) are marked with "x" or "" using TextBoxes for Yes and No
(eg tobi -> male? [x] Yes [ ] No, Tina -> male? [ ] Yes [x] No) depending on the entry in a sheet ive set before. Now this works back and forth, thus allowing me to change criteria (eg gender change). Additionaly i got a CommandButton allowing me to set new entries in the last row and setting "x" and "" whereever it is needed. The sheet now show the correct data, the UserForm however does not show a new circle of friends that is actually in the sheet by now. If i restart however it shows in the ComboBox. Any suggestions? Im initially not going to post parts of the code as everything works fine and im only looking for additional functionality.
2. TextBox DblClick
As mentioned above i got 2 TextBoxes to fill with an "x" or not ( i did not use ControlBoxes as there does not seem to been any way to alter the size of the actual Box). As its "too much work" to type an "x" i would like it to be shown as i double blick the box. This does not seem to work though.. Any suggestions in this matter? Wouldnt mind trying a completely different approach either. Heres the code:
Private Sub TextBox1_DblClick()
Dim lindex As Long
If ListBox1.ListIndex >= 0 Then
lindex = 2
Do While Trim(CStr(Sheets(1).Cells(lindex, 1).Value)) <> ""
If ListBox1.Text = Trim(CStr(Sheets(1).Cells(lindex, 3).Value)) Then
Sheets(1).Cells(lindex, 4).Value = "x"
Exit Do
End If
lindex = lindex + 1
Loop
End If
End SubThank you guys in advance!