+ Reply to Thread
Results 1 to 5 of 5

UserForm : Want to link Listbox1 with Listbox2 and delete data with one button

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    1,997

    UserForm : Want to link Listbox1 with Listbox2 and delete data with one button

    hello
    i m using listbox1 and listbox2 to delete data form two different NameRange and different sheets using two command button

    i want, when i tick a box of first listbox1 than auto tick same value of listbox2 and delete the data with using one command Button not two,

    thanx
    Attached Files Attached Files

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2013 on Win10 (desktop), 2007 on Win10 (notebook)
    Posts
    8,094

    Re: UserForm : Want to link Listbox1 with Listbox2 and delete data with one button

    Hi, haroon2015,

    I donīt see the necessity for 2 Listboxes with identical names as both lists could be handled in one ListBox. Due to the specifications you made the lists need to be identical as you refer to the position in the list and not to the name of the person (which would be more robust and allow different lists both on number of persons as of order of these). And to go into the future: no,I wonīt deliver code for this sceanrio as you didnīt ask for it in the opening post.

    Code behind the UserForm:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    1,997

    Re: UserForm : Want to link Listbox1 with Listbox2 and delete data with one button

    Hello, HaHoBe

    i don't want to delete entire row, because there is data in other columns

    i used ClearContents in my previous code

    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2013 on Win10 (desktop), 2007 on Win10 (notebook)
    Posts
    8,094

    Re: UserForm : Want to link Listbox1 with Listbox2 and delete data with one button

    Gi, haroon2015,

    nobody is deleting entire rows unless you changed the code I supplied - when using Clearcontents maybe clear the contents of the second entry on the list and report back about what happens to the length of your list when you use that command...

    Ciao,
    Holger

  5. #5
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    1,997

    Re: UserForm : Want to link Listbox1 with Listbox2 and delete data with one button

    Yes U r Right, HaHoBe,

    i was thinking wrong , code is working perfect, thanx alot HaHoBe

    will add u reputation

+ 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. copy selection from listbox1 to listbox2 in userform
    By Decar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2014, 07:26 AM
  2. [SOLVED] Listbox1 items to move in Listbox2.
    By siobeh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2014, 03:18 PM
  3. [SOLVED] Userform submit button to load listbox1 and listbox2 selection to same cell
    By wishn4fishn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2013, 03:06 PM
  4. [SOLVED] Transfer data from Userform1.listbox1 to userform2.listbox2
    By Vbadept in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2013, 08:28 AM
  5. Listbox1 to Listbox2?
    By Moretakitty in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-20-2005, 07:06 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