+ Reply to Thread
Results 1 to 4 of 4

Day and Month Spinner VBA

  1. #1
    Registered User
    Join Date
    08-05-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    25

    Day and Month Spinner VBA

    Hi folks,

    I am in the process of creating a report. I am using what I call a "Date Range Selector" that utilizes a spin up and down button, as well as a form selection for monthly and daily. Essentially you can open the report and select if you want to view the data by month, or by day. I think I have all of cell references set up correctly starting in O2. Now when I have selected the "Daily" option I can cycle through up or down just fine and excel pulls back whatever that date is for me. Now when I select Monthly, the spinner doesn't work (I believe because the code is set to look for weekly data) Ideally I would want the spinner to continue working how it does for the daily option, but then look at cell p2 & p3 to pull back the month and then start cycling through up or down by month.

    I know this sounds a little confusing so attached you will find a copy of the work book, I will also include a copy of the code below.

    The spinner works by looking at the listed days. You can find all of this info starting in cell o1 and over. I would like to keep everything how it is, but find a way to use the spinner to move through months. Basically when I click the spin up button cell P1 will move to the first day of the next month, and cell p2 will move to the last day of the next month (and the opposite when pushing the spin down button).

    Thanks!


    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Day and Month Spinner VBA

    Hi N,

    Try:

    Please Login or Register  to view this content.
    Last edited by xladept; 08-20-2014 at 06:04 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    08-05-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    25

    Re: Day and Month Spinner VBA

    That worked perfectly, thank you!

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Day and Month Spinner VBA

    You're welcome and thanks for the rep!

+ 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] Auto instert Month names for This month, Last month and Next month
    By hemal89 in forum Word Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2013, 12:01 PM
  2. Excel 2007 : Add a Spinner
    By cd3atm in forum Excel General
    Replies: 1
    Last Post: 11-03-2010, 12:13 AM
  3. Spinner and Dates
    By cybercab in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2006, 01:39 PM
  4. Spinner
    By Maureen in forum Excel General
    Replies: 2
    Last Post: 05-23-2005, 10:06 AM
  5. Spinner-requiring Spinner buttons
    By Greg Robinson via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2005, 07:34 PM

Tags for this Thread

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