+ Reply to Thread
Results 1 to 7 of 7

listbox to listbox data transfering problem

Hybrid View

rukman listbox to listbox data... 09-13-2017, 06:38 PM
Norie Re: listbox to listbox data... 09-13-2017, 06:44 PM
rukman Re: listbox to listbox data... 09-13-2017, 06:46 PM
Norie Re: listbox to listbox data... 09-13-2017, 06:55 PM
rukman Re: listbox to listbox data... 09-13-2017, 07:03 PM
Norie Re: listbox to listbox data... 09-13-2017, 07:17 PM
rukman Re: listbox to listbox data... 09-13-2017, 07:26 PM
  1. #1
    Registered User
    Join Date
    05-03-2011
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2016
    Posts
    98

    listbox to listbox data transfering problem

    Hi Friends and Gurus..


    Here I attached the my worksheet...


    in this is listbox 1 & 2 & 3 populate the values correctly...


    now I checked option button1 (Day)

    then I double click the value from listbox3 then . its need remove from listbox3 and go to listbox 4(Day Duty)..

    or

    Option button 2 (Night) selected

    then I double click the value from listbox3 then . its need remove from listbox3 and go to listbox 5(Night Duty)..


    try the eg...


    list box 1 = nb2

    listbox 2 = centercore

    listbox 3 = w5 mohan

    I checked the option button1 (day) and double click the mohan ------> its removed and go to listbox4
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: listbox to listbox data transfering problem

    There's no code for ListBox3 in the attached workbook.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    05-03-2011
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: listbox to listbox data transfering problem

    Thats only i need. idont have idea.. please help me

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: listbox to listbox data transfering problem

    Try this.
    Private Sub ListBox3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    Dim idx As Long
    
        idx = ListBox3.ListIndex
    
        If idx <> -1 Then
            Select Case True
                Case OptionButton1.Value    ' day
                    ListBox4.AddItem ListBox3.List(idx)
                Case OptionButton2.Value    ' night
                    ListBox5.AddItem ListBox3.List(idx)
                Case OptionButton3.Value    ' OT
                    ListBox6.AddItem ListBox3.List(idx)
            End Select
            ListBox3.RemoveItem idx
        End If
    
    End Sub

  5. #5
    Registered User
    Join Date
    05-03-2011
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: listbox to listbox data transfering problem

    Its Working but small problem....

    Listbox3 had multiple columns... i need same in listbox4 and listbox5

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: listbox to listbox data transfering problem

    First change the ColumnCount of the ListBox4 and ListBox5 (and ListBox6?) to 2.

    Then change the code for ListBox3 to this.
    Private Sub ListBox3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    Dim idx As Long
    Dim lst As MSForms.ListBox
    
        idx = ListBox3.ListIndex
    
        If idx <> -1 Then
            Select Case True
                Case OptionButton1.Value    ' day
                    Set lst = ListBox4
    
                Case OptionButton2.Value    ' night
                    lst = ListBox5
                Case OptionButton3.Value    ' OT
                    lst = ListBox6
            End Select
    
            If Not lst Is Nothing Then
                With lst
                    .AddItem
                    .List(.ListCount - 1, 0) = ListBox3.List(idx, 0)
                    .List(.ListCount - 1, 1) = ListBox3.List(idx, 1)
                End With
                ListBox3.RemoveItem idx
    
            End If
        End If
    
    End Sub

  7. #7
    Registered User
    Join Date
    05-03-2011
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: listbox to listbox data transfering problem

    Thank you very much... this is very useful to my further implementation

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] ListBox column data transfer to another ListBox
    By gsandy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2016, 08:26 PM
  2. transfering data from multicolumn listbox to different columns in an excel sheet
    By eddyrcabrera79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2015, 03:04 PM
  3. [SOLVED] if anything in listbox select first item, if listbox empty do nothing (listbox in userform
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 12:49 PM
  4. [SOLVED] problem with listbox output to another listbox
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-02-2013, 04:52 AM
  5. [SOLVED] Transferring data from listbox to listbox
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-22-2013, 03:19 AM
  6. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  7. Listbox data display problem
    By Henry in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-11-2005, 08:00 PM

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