#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Input Box

How do I set the criteria for the filter?

I will get a date from the input box, how do I get this into the filter part
of the macro?

Thanks.
"Tom Ogilvy" wrote in message
...
click in the first line of the sheet (assume row1 with headers in that

row)
and do Data=Filter=Autofilter

in the dropdown in Column B, select custom and in the resulting dialog,
select Is less than, then put in the date that would be the first date not
deleted.

Now select all the rows but the header row and do Edit=Delete

Only visible rows will be delete

then Data=Filter=Autofilter to turn off the filter

You can turn on the macro recorder when you do this. Then if you want to
add a input box and set the filter criteria using that, you can just

modify
the recorded code.

--
Regards,
Tom Ogilvy


"Gareth" wrote in message
...
I have a sheet of data made up of telephone enquiries.

It starts on the 01/01/2002 and runs to today.

What I want is code to show an input box asking the user for a date

(usually
today but not always). I then want all enqiries that are more than a

year
older than the date entered to be deleted from the sheet.

The sheet is called "Enquiries = 01/01/2002" and the date is in column

B.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Input Box

After recording

Criteria1:="<=01/15/2003"

so

res = Cdate(Inputbox("enter date"))

.. . .

Criteria1:="<=" & clng(res)
--
Regards,
Tom Ogilvy


Gareth wrote in message
...
How do I set the criteria for the filter?

I will get a date from the input box, how do I get this into the filter

part
of the macro?

Thanks.
"Tom Ogilvy" wrote in message
...
click in the first line of the sheet (assume row1 with headers in that

row)
and do Data=Filter=Autofilter

in the dropdown in Column B, select custom and in the resulting dialog,
select Is less than, then put in the date that would be the first date

not
deleted.

Now select all the rows but the header row and do Edit=Delete

Only visible rows will be delete

then Data=Filter=Autofilter to turn off the filter

You can turn on the macro recorder when you do this. Then if you want

to
add a input box and set the filter criteria using that, you can just

modify
the recorded code.

--
Regards,
Tom Ogilvy


"Gareth" wrote in message
...
I have a sheet of data made up of telephone enquiries.

It starts on the 01/01/2002 and runs to today.

What I want is code to show an input box asking the user for a date

(usually
today but not always). I then want all enqiries that are more than a

year
older than the date entered to be deleted from the sheet.

The sheet is called "Enquiries = 01/01/2002" and the date is in

column
B.

I imagined some kinf of filter then delete but was unable to code it.

Thanks in advance.

Gareth










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM


All times are GMT +1. The time now is 03:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"