+ Reply to Thread
Results 1 to 1 of 1

ListBox Display

Hybrid View

kieranbop ListBox Display 10-25-2011, 09:39 AM
  1. #1
    Forum Contributor
    Join Date
    09-08-2011
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    157

    ListBox Display

    I have populated data on a listbox reading in from current excel and also theirs a delete function in place. I was wondering if its possible, in regards to the listbox when you double click a value on the listbox, it will let you input all the corresponding data it comes with on your userform.

    Private Sub UserForm_Initialize()
       For i = 2 To ActiveSheet.Cells(Rows.Count, 3).End(xlUp).Row
          If Range("C" & i).Value = frmCourseBooking.txt_Request Then
               list_display.AddItem Range("D" & i).Value & ", " & Range("E" & i).Value & ", " & Range("F" & i).Value
               list_display.List(list_display.ListCount - 1, 1) = i '''''' added
          End If
          
       Next i
    
    End Sub
    
    Private Sub cmdDelete_Click()
    
       If list_display.ListIndex >= 0 Then
          ActiveSheet.Cells(list_display.List(list_display.ListIndex, 1), 1).EntireRow.Delete ''''''''' added
          list_display.RemoveItem list_display.ListIndex
       End If
    
    End Sub
    code used for populating


    Looking at attached file. Run userform
    In regular users put in "U403114" then click active requests, it will run the listbox with all the corresponding information
    On double clicking that information I want it to write out to the userform in the corresponding boxes
    then whatever's it has read in, if i edit one, override the one its reading in


    Any help appreciated



    The attached file, when you run it, put user id U403114 in the active requests option it populates that data, but what I want after that, whatever data I click on for it to read that data in then override it's current values .
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1