Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2006, 03:43 PM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to alexyss15 Send a message via MSN to alexyss15 Send a message via Yahoo to alexyss15
Default Macro/Date/Advanced Filter

I'm looking for a way to have a macro use the advanced filter to filter out a date using the greater than or equal to.

The date needs to be changeable, so I have the user inputing the date, but can't figure out how to get the advanced filter to work when inputing the date manually (via InputBox).

This is as far as my macro goes for now, because I'm stuck:

    Rows("1:4").Select
    Selection.Insert Shift:=xlDown
    Range("E5").Select
    Selection.Copy
    Range("E1").Select
    ActiveSheet.Paste
    ActiveWindow.LargeScroll ToRight:=1
    Range("Q5:R5").Select
    Application.CutCopyMode = False
    Selection.Copy
    ActiveWindow.LargeScroll ToRight:=-1
    Range("F1").Select
    ActiveSheet.Paste
    Date = InputBox(prompt:="Please Enter Date")
    If Date = " " Then Exit Sub
    Range("D2").Value = Date

The criteria range is going to be in E2:G2. And the InputBox won't allow me to put the date as >="Date"

Any ideas?

 
Old March 30th, 2006, 01:06 PM
Authorized User
 
Join Date: Mar 2006
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

date is a reserved word.. so trying to assign a variable which is not in date format will produce an error. I am not sure if you are saying you would like to enter into the imput box '>="Date"' or do you mean any date in the future






Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter dataset by Date? spacky001 ASP.NET 2.0 Basics 1 January 23rd, 2007 07:17 PM
Filter form with date fields problem!! chiefouko Access 2 August 14th, 2006 10:15 AM
sql date filter keyvanjan Classic ASP Databases 3 March 8th, 2006 10:17 PM
Automatically Applying Advanced Filter / Sort bridog39 Access 4 November 24th, 2005 04:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.