Consulting

Results 1 to 8 of 8

Thread: Filter On Date With Headers

  1. #1
    VBAX Newbie
    Joined
    Sep 2017
    Posts
    5
    Location

    Filter On Date With Headers

    Quote Originally Posted by p45cal View Post
    Awkward ain't it? Try:[VBA]Sub blah()
    x = CLng(Date)
    ActiveSheet.UsedRange.AutoFilter Field:=2, Criteria1:=">=" & x, Operator:=xlAnd, Criteria2:="<" & x + 1
    End Sub
    [/VBA]
    I need help please....this today date filter is really tricky. Your VBA it works great but it doesn't filter with header I need also headers....thank you

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Newbie
    Joined
    Sep 2017
    Posts
    5
    Location
    Just found the solutuion still thank u P45CAL for your code.
    Sub Ufa()    
    Dim LastRrow As Long    
    LastRrow = Attuale.Range("A" & Rows.Count).End(xlUp).Row
    x = CLng(Date)
    ActiveSheet.Range("A9:J" & LastRrow).AutoFilter Field:=9, Criteria1:=">=" & x, Operator:=xlAnd, Criteria2:="<" & x + 1 
    End Sub

  4. #4
    VBAX Newbie
    Joined
    Sep 2017
    Posts
    5
    Location
    Thank you Sam...sorry if I used an old thread....

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    It's OK.

    In fact, old threads have been under discussion by the Moderators for a while now. We are all trying to figure out the best way to handle them for members.

    What do you think?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  6. #6
    VBAX Newbie
    Joined
    Sep 2017
    Posts
    5
    Location
    Thank you, yeah in fact is not an easy issue, becase for me I searched it and it was what I was looking for so I didn't thought of a new thread ...but yeah when it is so old it should be a new thread I think. The problem was that I wanted to give credit to P45CAL for the code and not put it as a new thread as a code of mine......but also to get the attention on that topic because as it was the code of P45CAL he would easly know the answer of my question and I thought I would have more possibilities of getting an asnwer .

    Quote Originally Posted by SamT View Post
    It's OK.

    In fact, old threads have been under discussion by the Moderators for a while now. We are all trying to figure out the best way to handle them for members.

    What do you think?

  7. #7
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I don't blame you, I probably would have done the same.

    However the experts here mostly have jobs and often don't come by here for days and even weeks at a time. I'm retired and took up Programming as a hobby.

    If you found the answer, you can mark your thread Solved with the Thread Tools link.

    FYI, the difference between Date and NOW is that Date returns an integer, where Now returns a decimal number, Excel stores all dates and times as Doubles, then they are formatted for human consumption.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  8. #8
    VBAX Newbie
    Joined
    Sep 2017
    Posts
    5
    Location
    What you guys are doing is amazing......I just thank you all the time because you share information and you put your time in helping other people. I have been thankful lots of time to people like you and others who had helped me with my question. It is really amazing and admirable. THANK YOU SO MUCH FOR YOUR GREAT WORK.

    Marked as Solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •