Consulting

Results 1 to 12 of 12

Thread: UserForm Update/TextBox DblClick

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    May 2017
    Posts
    26
    Location

    Question UserForm Update/TextBox DblClick

    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 Sub
    Thank you guys in advance!
    Last edited by SamT; 05-11-2017 at 05:21 AM. Reason: Added Code Tags with # Menu icon

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •