Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Macro using autofilter

I am building a macro so that people in my organization can produce reports
based on a customer satisfaction spreadsheet database. I need to be able to
pull data from the customer responses based on date ranges and I am thinking
that the autofilter is the best choice for this. I want people to be able to
input a from date for the greater than = to choice in autofilter and input
and end date for the less than = to choice. I would then like to have them
click on a radio button to initiate the macro and have the macro run the
routine to pull the information to a query spreadsheet from the satisfaction
spreadsheet based on the dates given. Piece of cake I am sure for you MVP
types, but I am stumped on how to have the autofilter pull the dates for the
query from the input cells. :(

Your help would be hugely appreciated.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Macro using autofilter

Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=subroutine",
Operator:=xlAnd _
, Criteria2:="<=subroutine2"

Sorry Don, I have never done this before. (see sheepish expression on my
face). It is in the part for criteria 1 and criteria 2 that I need the macro
to pause for input, or else to reference another cell in the first or second
row of the spreadsheet to get the date from and date to. Thanks for your
help!

"Don Guillett" wrote:

As always, post your coding efforts for comments and suggestions.
c1 = InputBox("Enter Criteria 1")
MsgBox c1

--
Don Guillett
SalesAid Software

"Lorna B" wrote in message
...
I am building a macro so that people in my organization can produce reports
based on a customer satisfaction spreadsheet database. I need to be able
to
pull data from the customer responses based on date ranges and I am
thinking
that the autofilter is the best choice for this. I want people to be able
to
input a from date for the greater than = to choice in autofilter and input
and end date for the less than = to choice. I would then like to have
them
click on a radio button to initiate the macro and have the macro run the
routine to pull the information to a query spreadsheet from the
satisfaction
spreadsheet based on the dates given. Piece of cake I am sure for you MVP
types, but I am stumped on how to have the autofilter pull the dates for
the
query from the input cells. :(

Your help would be hugely appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro using autofilter

try this. I didn't test. BTW, you should try to NOT use selections. Use the
range instead. I suspect that the rest of your code is also full of
unnecessary and undesirable selections.

c1 = InputBox("Enter Criteria 1")
c2= InputBox("Enter Criteria 2")
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=" & c1 &",
Operator:=xlAnd _
, Criteria2:="<=" & c2


--
Don Guillett
SalesAid Software

"Lorna B" wrote in message
...
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=subroutine",
Operator:=xlAnd _
, Criteria2:="<=subroutine2"

Sorry Don, I have never done this before. (see sheepish expression on my
face). It is in the part for criteria 1 and criteria 2 that I need the
macro
to pause for input, or else to reference another cell in the first or
second
row of the spreadsheet to get the date from and date to. Thanks for your
help!

"Don Guillett" wrote:

As always, post your coding efforts for comments and suggestions.
c1 = InputBox("Enter Criteria 1")
MsgBox c1

--
Don Guillett
SalesAid Software

"Lorna B" wrote in message
...
I am building a macro so that people in my organization can produce
reports
based on a customer satisfaction spreadsheet database. I need to be
able
to
pull data from the customer responses based on date ranges and I am
thinking
that the autofilter is the best choice for this. I want people to be
able
to
input a from date for the greater than = to choice in autofilter and
input
and end date for the less than = to choice. I would then like to have
them
click on a radio button to initiate the macro and have the macro run
the
routine to pull the information to a query spreadsheet from the
satisfaction
spreadsheet based on the dates given. Piece of cake I am sure for you
MVP
types, but I am stumped on how to have the autofilter pull the dates
for
the
query from the input cells. :(

Your help would be hugely appreciated.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Macro using autofilter

I must be a real idiot. Thank you so much for being so helpful. I have
changed my code, however when I test the macro I get a runtime error at the
"Selection.AutoFilter"

"Don Guillett" wrote:

try this. I didn't test. BTW, you should try to NOT use selections. Use the
range instead. I suspect that the rest of your code is also full of
unnecessary and undesirable selections.

c1 = InputBox("Enter Criteria 1")
c2= InputBox("Enter Criteria 2")
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=" & c1 &",
Operator:=xlAnd _
, Criteria2:="<=" & c2


--
Don Guillett
SalesAid Software

"Lorna B" wrote in message
...
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=subroutine",
Operator:=xlAnd _
, Criteria2:="<=subroutine2"

Sorry Don, I have never done this before. (see sheepish expression on my
face). It is in the part for criteria 1 and criteria 2 that I need the
macro
to pause for input, or else to reference another cell in the first or
second
row of the spreadsheet to get the date from and date to. Thanks for your
help!

"Don Guillett" wrote:

As always, post your coding efforts for comments and suggestions.
c1 = InputBox("Enter Criteria 1")
MsgBox c1

--
Don Guillett
SalesAid Software

"Lorna B" wrote in message
...
I am building a macro so that people in my organization can produce
reports
based on a customer satisfaction spreadsheet database. I need to be
able
to
pull data from the customer responses based on date ranges and I am
thinking
that the autofilter is the best choice for this. I want people to be
able
to
input a from date for the greater than = to choice in autofilter and
input
and end date for the less than = to choice. I would then like to have
them
click on a radio button to initiate the macro and have the macro run
the
routine to pull the information to a query spreadsheet from the
satisfaction
spreadsheet based on the dates given. Piece of cake I am sure for you
MVP
types, but I am stumped on how to have the autofilter pull the dates
for
the
query from the input cells. :(

Your help would be hugely appreciated.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro using autofilter

I had "" wrong. NOW tested. Use the top of your range
Sub FilterInputCriteria()

c1 = InputBox("Enter Criteria 1")
c2 = InputBox("Enter Criteria 2")

With Range("A7:D7")
.AutoFilter
.AutoFilter Field:=1, Criteria1:="=" & c1 & "" _
, Operator:=xlAnd, Criteria2:="<=" & c2 & ""
End With
End Sub

--
Don Guillett
SalesAid Software

"Lorna B" wrote in message
...
I must be a real idiot. Thank you so much for being so helpful. I have
changed my code, however when I test the macro I get a runtime error at
the
"Selection.AutoFilter"

"Don Guillett" wrote:

try this. I didn't test. BTW, you should try to NOT use selections. Use
the
range instead. I suspect that the rest of your code is also full of
unnecessary and undesirable selections.

c1 = InputBox("Enter Criteria 1")
c2= InputBox("Enter Criteria 2")
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=" & c1 &",
Operator:=xlAnd _
, Criteria2:="<=" & c2


--
Don Guillett
SalesAid Software

"Lorna B" wrote in message
...
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=subroutine",
Operator:=xlAnd _
, Criteria2:="<=subroutine2"

Sorry Don, I have never done this before. (see sheepish expression on
my
face). It is in the part for criteria 1 and criteria 2 that I need the
macro
to pause for input, or else to reference another cell in the first or
second
row of the spreadsheet to get the date from and date to. Thanks for
your
help!

"Don Guillett" wrote:

As always, post your coding efforts for comments and suggestions.
c1 = InputBox("Enter Criteria 1")
MsgBox c1

--
Don Guillett
SalesAid Software

"Lorna B" wrote in message
...
I am building a macro so that people in my organization can produce
reports
based on a customer satisfaction spreadsheet database. I need to be
able
to
pull data from the customer responses based on date ranges and I am
thinking
that the autofilter is the best choice for this. I want people to
be
able
to
input a from date for the greater than = to choice in autofilter and
input
and end date for the less than = to choice. I would then like to
have
them
click on a radio button to initiate the macro and have the macro run
the
routine to pull the information to a query spreadsheet from the
satisfaction
spreadsheet based on the dates given. Piece of cake I am sure for
you
MVP
types, but I am stumped on how to have the autofilter pull the dates
for
the
query from the input cells. :(

Your help would be hugely appreciated.





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
Can I use a macro to autofilter in excel priceyindevon Excel Worksheet Functions 0 October 14th 06 06:47 PM
autofilter macro flow23 Excel Discussion (Misc queries) 1 April 18th 06 03:00 PM
macro for 4 constraints in autofilter Gus Excel Discussion (Misc queries) 1 August 4th 05 01:17 PM
Keep autofilter after macro is run gmr7 Excel Worksheet Functions 2 July 5th 05 01:16 PM
Autofilter Macro Help RonB Excel Discussion (Misc queries) 1 December 30th 04 01:34 AM


All times are GMT +1. The time now is 08:51 AM.

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

About Us

"It's about Microsoft Excel"