+ Reply to Thread
Results 1 to 3 of 3

Formatting a date from userform, then filtering.

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Formatting a date from userform, then filtering.

    Hello Guys!

    Got a slight problem which I cannot seem to get my head around. I have a userform which writes a date into a cell within a row within a table. The code is

    Please Login or Register  to view this content.
    Everything works fine, the date gets sent to the cell as stated and is all correct. However, I also have vba which runs an advanced filter, which the following code is included in.

    Please Login or Register  to view this content.
    P7 and O7 are the advanced filter criteria. Basically in the form I have a "completion date" which is posted with the first code I posted. So lets say that the date posted is 25/07/14, and I want to have a filter of all the dates which are coming up in the next 7 days to be shown in the Advanced Filter results area of my spreadsheet.

    With the second part of code I posted, this results in nothing when using the advance filter. The original posted date in the cell (from the first code) is shown as "25/07/14". So when I run the advanced filter, nothing happens. HOWEVER, if I go to the cell containing "25/07/14", delete the contents and write "25/07/14" manually and then run the advanced filter (second code posted), the date shows up in the results working fine. But I dont understand how me typing it out again makes it work?

    Hope I am making myself clear?

    Many thanks in advance!

    Ash

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Formatting a date from userform, then filtering.

    Does the filter work if you use this to put the date in the cell?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Formatting a date from userform, then filtering.

    Quote Originally Posted by Norie View Post
    Does the filter work if you use this to put the date in the cell?
    Please Login or Register  to view this content.
    Yes, yes it does! Awesome.

    Thanks very much, do appriciate 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. How to filtering in a userform
    By fraz627 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2013, 05:45 PM
  2. Linking a Userform to a Table and filtering it.
    By BigJohnW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2012, 04:03 PM
  3. Excel 2007 : Filtering Data from excelsheet on the Userform
    By qiqinuinaifen128 in forum Excel General
    Replies: 1
    Last Post: 01-11-2012, 09:17 AM
  4. [SOLVED] Userform Date Formatting MM/DD/YYYY
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-09-2010, 12:51 AM
  5. Trouble with filtering in userform
    By bernie1961 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2008, 09:34 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