Results 1 to 30 of 30

Selecting Quarter 1, Year 2014 Dates in ListBox

Threaded View

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

    Selecting Quarter 1, Year 2014 Dates in ListBox

    Hello,

    I have a ListBox1 that is populated with Dates.

    I want to be able to assign a macro to a CommandButton that selects Quarter 1 dates for 2013. I wrote something like this:

    Private Sub CommandButton1_Click()
    For I = 0 To ListBox1.ListCount - 1
        If ListBox1.Selected(I) = Year(ListBox1.List(I)) = 2013 Then
            ListBox1.Selected(I) = Month(ListBox1.List(I)) = 1
            ListBox1.Selected(I) = Month(ListBox1.List(I)) = 2
            ListBox1.Selected(I) = Month(ListBox1.List(I)) = 3
        End If
    Next I
    End Sub
    It doesn't error, it just doesn't work. The code should select all values in the ListBox1 1/1/2013-3/31/2013

    I don't understand how to select a YEAR & MONTH to run through a loop and select.
    Attached Files Attached Files
    Last edited by EnigmaMatter; 03-07-2014 at 09:46 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Using SumProduct for dates inclusive of Year to Date, Month to date, Quarter to Date
    By cartica in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2014, 04:22 PM
  2. [SOLVED] Pivot Table Not Pulling 2014 Dates
    By Oscar Martin in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-13-2014, 11:24 AM
  3. Replies: 3
    Last Post: 01-30-2014, 08:19 PM
  4. [SOLVED] PIVOT TABLES: Grouping dates by Fiscal Year, Quarter and Month
    By bimmer5dude in forum Excel General
    Replies: 5
    Last Post: 06-30-2012, 09:13 PM
  5. StaticDate() Function shows year as 2014?
    By Samba1 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 06-08-2010, 12:40 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