+ Reply to Thread
Results 1 to 5 of 5

Adding new items to Multi-Column Listbox on seperate Userform

  1. #1
    Registered User
    Join Date
    04-03-2013
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Adding new items to Multi-Column Listbox on seperate Userform

    In summary, I am trying to add new items to a multi-columned listbox on a seperate userform from the one where the user input data is located. I'm in Excel 2010.

    The first Userform (addTask) is where a new task can be input. There is a button to upload a subtask which opens a new userform (addSubtoTask) where information about a subtask can be input. There can be multiple subtasks, so I thought a multicolumned listbox (ListTasks) would work to store the different subtasks until the user chooses to add all of the Tasks and Subtasks to the spreadsheet. My code adds the first line to the Listbox but this and almost every other variant rewrites the first line. The one version that let me add multiple rows only worked if I didn't unload the addSubtoTask userform but once i closed it, it would of course start back up rewriting the first row.

    Please Login or Register  to view this content.
    Any help would be wonderful.

    Thank you

  2. #2
    Registered User
    Join Date
    04-03-2013
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Adding new items to Multi-Column Listbox on seperate Userform

    Is anyone able to help with this? Am I going about it all wrong?

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

    Re: Adding new items to Multi-Column Listbox on seperate Userform

    Change ListIndex to .ListCount-1 - remember the . in front, it's important.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    04-03-2013
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Adding new items to Multi-Column Listbox on seperate Userform

    That it is I had used "ListCount - 1" but had apparently forgotten the "."

    Thanks Heaps

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

    Re: Adding new items to Multi-Column Listbox on seperate Userform

    No problem.

    If you had Option Explicit at the top of the module that might have been caught earlier.

    That's because ListIndex (or ListCount) would be seen as undeclared variables.

    Now that wouln't necessarily stop the code working but it would produce incorrect results.

+ 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. Multi select Listbox Items selection based on other Listbox item selection.
    By srinivassathi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2011, 05:53 AM
  2. removing and replacing items in multi column listbox.
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2009, 10:20 AM
  3. Multi Column UserForm ListBox
    By Mik in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2006, 05:15 PM
  4. [SOLVED] multi-column listbox on userform, multiple issues
    By KR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2006, 04:00 PM
  5. Sort a multi column listbox in userform
    By Martin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-07-2005, 05:05 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