+ Reply to Thread
Results 1 to 6 of 6

Show ListBox based on CommandButton

  1. #1
    Forum Contributor
    Join Date
    01-14-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    109

    Show ListBox based on CommandButton

    Good day

    I have created a macro to create different list. On UserForm1 I have added command buttons.
    I need the listBox to display the list as created in the tab's, e.g. Prepacks when I select CommandButton6 on UserForm1
    This needs to display and then be able to close so another can be selected, e.g. Prosegur, etc
    I have tried to use the following on my ListBox1 as the RowSource =OFFSET(Prepacks!$B$1:$D$100,0,0,COUNTAPrepacks!$B:$D),3)
    It keeps giving me an error - "Could not set the RowSource property. Invalid property value"
    If anyany can assit with creating one ListBox I am sure I will be able to create the others.

    Any help will be greatly appreciated
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Show ListBox based on CommandButton

    If that is the formula you are using, there appears to be a bracket missing.

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

    Re: Show ListBox based on CommandButton

    Not sure which listbox you want to populate but you could use this.
    Please Login or Register  to view this content.
    Last edited by Norie; 06-17-2014 at 08:51 AM.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    01-14-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Show ListBox based on CommandButton

    Thank you Dave
    Cant believe i didnt see it

  5. #5
    Forum Contributor
    Join Date
    01-14-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Show ListBox based on CommandButton

    Also, Thank you Nori

  6. #6
    Forum Contributor
    Join Date
    01-14-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Show ListBox based on CommandButton

    I have managed to conclude this
    Thanks to everyone who assisted.
    I have uploaded the completed file for completeness of this thread should anyone want to see or use it at a later stage
    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)

Similar Threads

  1. Print ListBox data with a commandbutton
    By Doctor_H in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2013, 04:09 PM
  2. [SOLVED] Populating ListBox using value from Combobox via CommandButton
    By Doctor_H in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-04-2013, 05:56 PM
  3. Commandbutton in userform to execute code based on a previous commandbutton choice?
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2012, 03:28 PM
  4. Listbox to textbox via commandbutton
    By himanshu83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2010, 03:14 PM
  5. find value in sheet based on combobox and show in listbox
    By herukuncahyono in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2010, 05:43 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