+ Reply to Thread
Results 1 to 7 of 7

Select All Selections in ListBox1 that contain X

  1. #1
    Forum Contributor
    Join Date
    02-04-2014
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    366

    Select All Selections in ListBox1 that contain X

    Hello,

    I have a ListBox1 full of dates formatted as M/D/YYYY or M/DD/YYYY.

    When I click CommandButton1, I want all dates that contain 2014 to be selected.

    I have attached a sample workbook. Any ideas?
    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: Select All Selections in ListBox1 that contain X

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    02-04-2014
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    366

    Re: Select All Selections in ListBox1 that contain X

    ...I would have never guessed there was a built-in method for that.

    Is there something similar for defining months?

    I am trying to make a button for Quarter 1, Quarter 2, etc.

  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: Select All Selections in ListBox1 that contain X

    No, but it wouldn't be too hard to do it for quarters as long as you had a clear definition of the quarters.

    For example Jan 1 - Mar 31, Apr 1 - Jun 30, Jul 1 - Sep 30, Oct 1 - Dec 31 for quarters 1,2,3,4 respectively.

  5. #5
    Registered User
    Join Date
    08-06-2013
    Location
    Quebec
    MS-Off Ver
    Excel 2013
    Posts
    31

    Re: Select All Selections in ListBox1 that contain X

    For months:

    same coding, but with "Month" instead of "Year", and value from 1 to 12.

    Example with month of December:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-04-2014
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    366

    Re: Select All Selections in ListBox1 that contain X

    Thanks to both of you.

  7. #7
    Forum Contributor
    Join Date
    02-04-2014
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    366

    Re: Select All Selections in ListBox1 that contain X

    I have a FU question, that should probably be in a new thread.
    Last edited by EnigmaMatter; 03-06-2014 at 06:02 PM. Reason: Should be in new Thread.

+ 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] Select Range based on COmboBox selections
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2013, 11:24 PM
  2. How can I select multiple selections of pages for one print job
    By spira in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2013, 11:34 PM
  3. List Box Selections Outputting Multiple Selections with One Click
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-21-2011, 12:27 PM
  4. Multiple selections from a pick list - only unique selections (no repeats) ?
    By opsayo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2011, 06:25 PM
  5. Select whole row of multiple cell selections
    By newayblue in forum Excel General
    Replies: 4
    Last Post: 06-17-2010, 07:08 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