Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VBA (Excel) filter by date

VBA (Excel) filter by date

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    progDes
    wrote on last edited by
    #1

    Hi all Please help! How to write filter by date in macro in Excel? Automatic generated macro looks like this: Selection.AutoFilter Field:=10, Criteria1:=">=01.01.2007", Operator:=xlAnd, _ Criteria2:="<01.01.2008" But this macro is not working. :( Thanks

    K 1 Reply Last reply
    0
    • P progDes

      Hi all Please help! How to write filter by date in macro in Excel? Automatic generated macro looks like this: Selection.AutoFilter Field:=10, Criteria1:=">=01.01.2007", Operator:=xlAnd, _ Criteria2:="<01.01.2008" But this macro is not working. :( Thanks

      K Offline
      K Offline
      Khatri Mitesh
      wrote on last edited by
      #2

      Hiiiii Selection.AutoFilter Field:=10, Criteria1:=">=#01.01.2007#", Operator:=xlAnd, _ Criteria2:="<#01.01.2008#" and also check the date format of your system is "dd.mm.yyyy" or "mm.dd.yy" For the comparison with Date use the # character. May be this solve your problem. Thanx Mitesh Khatri khatrimitesh@hotmail.com

      modified on Wednesday, June 11, 2008 7:26 AM

      P 1 Reply Last reply
      0
      • K Khatri Mitesh

        Hiiiii Selection.AutoFilter Field:=10, Criteria1:=">=#01.01.2007#", Operator:=xlAnd, _ Criteria2:="<#01.01.2008#" and also check the date format of your system is "dd.mm.yyyy" or "mm.dd.yy" For the comparison with Date use the # character. May be this solve your problem. Thanx Mitesh Khatri khatrimitesh@hotmail.com

        modified on Wednesday, June 11, 2008 7:26 AM

        P Offline
        P Offline
        progDes
        wrote on last edited by
        #3

        Unfortunatly its not working too :(

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups