Results 1 to 16 of 16

ListBox Double Click not Adding to another TextBox

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-04-2017
    Location
    Phillipines
    MS-Off Ver
    2016
    Posts
    169

    ListBox Double Click not Adding to another TextBox

    Hello all,

    I need help why this code is working for the first textbox only not working to add value another textbox?
    How to code to remove in textbox 1 to 1 x 1

    Thanks for the Help.

    Private Sub cmdList_Click()
        Dim a, i As Long, n As Long, w()
    ActiveSheet.Unprotect ("@Chandria2017")
    
        a = Sheets("DataRecord").Cells(1).CurrentRegion.Value
      ' nn = 10
           
        For i = 5 To UBound(a, 1)
            If CStr(a(i, 10)) = Me.txtSearch.Value Then
           
                n = n + 1
               
                ReDim Preserve w(1 To n)
                w(n) = Application.Index(a, i, Array(11, 7, 5, 6, 10))
            End If
            
        Next
        If n > 0 Then
       
            If n > 1 Then
             
                listSearch.listSupply.List = Application.Index(w, 0, 0)
                listSearch.Show
            Else
                listSearch.listSupply.Column = w(1)
                 
            End If
        End If
    End Sub

    Private Sub listSupply_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
     Dim i As Long, x
        nn = nn + 1
        x = Array("q", "u", "pn", "d", "mr")
        
        With listSearch.listSupply
            For i = 0 To UBound(x)
            
                frmPO(x(i) & nn).Value = .List(.ListIndex, i)
                
            Next
            
         .RemoveItem .ListIndex
         ' If nn = 10 Then
         ' MsgBox "already full"
         '  End If
        End With
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Double Click/Enter Listbox
    By RJ1969 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-20-2017, 11:38 PM
  2. [SOLVED] Double-click a listbox inside a group
    By rodgersmg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2015, 08:23 AM
  3. [SOLVED] Move rows from one listbox to another by double click
    By Littlefarmer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2015, 10:39 AM
  4. [SOLVED] Double Click Listbox question
    By frostii in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2015, 09:15 PM
  5. Double click Listbox to edit item
    By johan12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2012, 04:12 AM
  6. Replies: 3
    Last Post: 08-10-2011, 02:02 PM
  7. [SOLVED] Need selected item from listbox after double click
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2006, 11:20 AM

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