+ Reply to Thread
Results 1 to 3 of 3

Battling to compare dates inputted in different methods

  1. #1
    Registered User
    Join Date
    08-17-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    35

    Battling to compare dates inputted in different methods

    Hi all

    I've searched around for this but cannot seem to come right.
    I've got a worksheet where the user enters a month and year in the same cell. I'm then using VBA to try find a cell in another worksheet that lists that month/year.
    For example, columns A to J list April 2015 to March 2016. The user will enter October 2015 and the macro should find the cell in column G. I can't seem to find the cell unless I capture the values as strings and compare exactly. But the user may input the date in a variety of ways which would leave that method useless (e.g. they may enter "Oct 15" or "01/10/2015"). How would I be able to convert the input to some type of date input and then compare the value of another cell formated in a date format?
    I admit that I am useless when it comes to dates. Never used them before.

    Thanks a lot
    Alan

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Battling to compare dates inputted in different methods

    Don't know about a VBA solution but you could use Data validation to force a constant entry format?

  3. #3
    Registered User
    Join Date
    08-17-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Battling to compare dates inputted in different methods

    Hmmm..... good idea, thanks.
    If I don't come right in VBA, I'll do that.

+ 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. Replies: 4
    Last Post: 02-17-2015, 08:15 AM
  2. how to accurately pick dates using vba or other excel methods
    By union in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2013, 05:35 AM
  3. battling with excell
    By JUPS in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-13-2012, 02:43 PM
  4. Convert inputted dates to visual calendar
    By fugro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2011, 11:49 PM
  5. Replies: 5
    Last Post: 04-06-2010, 05:33 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