+ Reply to Thread
Results 1 to 3 of 3

Userform Spin Up/Down to go to nearest Monday

  1. #1
    Registered User
    Join Date
    02-11-2014
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    61

    Userform Spin Up/Down to go to nearest Monday

    Hey all,

    So i've currently got this bit of code as follows:

    Please Login or Register  to view this content.
    Now this works fine to get me to a week either way of the date in the 'DateBox', but say if the date in there is a Tuesday, how would I get that to go to the nearest Monday? I tried using the WeekDay function but couldn't seem to get that to work.

    Example:
    Please Login or Register  to view this content.

    Thanks in advance.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Userform Spin Up/Down to go to nearest Monday

    This always returns a Monday date.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-11-2014
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    61

    Re: Userform Spin Up/Down to go to nearest Monday

    Thanks! Worked perfectly.

+ 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. Min and Max limits on Spin Button (userform)
    By syedmehdi in forum Excel General
    Replies: 1
    Last Post: 04-14-2015, 01:39 PM
  2. [SOLVED] Need a formula that reacts to a spin box and only shows monday dates
    By john dalton in forum Excel General
    Replies: 6
    Last Post: 03-24-2014, 09:17 AM
  3. [SOLVED] Calculate future date to nearest Monday
    By mswauger in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-09-2013, 04:13 PM
  4. Excel spin button on Userform
    By OneSurya in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-08-2013, 02:19 PM
  5. Nearest Monday
    By luvthavodka in forum Excel General
    Replies: 5
    Last Post: 07-21-2010, 06:13 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