Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Filtering data based on formula

Hi, I want to filter a table of data to display rows with values between two
numbers but the numbers will change as it is used, so the criteria values
have to be in the form of a formula.

ie.

A1 = Manually inputted data (eg 1)
B1 = Manually inputted data (eg 7)

A2 = A1
B2 = B1

F7 = "Day"
F8-F12 = Data (eg 2, 5, 1, 4, etc)
G7, H7 etc more data

How do I filter F7:H12 with the criteria that values in column F are =A2
and =<B2?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Filtering data based on formula

datafilterautofiltercustom
record a macro (and you may want to use "inputbox" instead of cell values
Sub Macro6()'recorded
'
' Macro6 Macro
' Macro recorded 4/22/2008 by Donald B. Guillett
'

'
Range("F2:H12").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=2", Operator:=xlAnd, _
Criteria2:="<=5"
End Sub
better
Sub filterbyday()
Range("F2:H12").AutoFilter Field:=1, _
Criteria1:="=2", Operator:=xlAnd, Criteria2:="<=5"
End Sub
best
Sub filterbyday()
c1 = InputBox("Enter 1st")
c2 = InputBox("enter last")
Range("F2:H12").AutoFilter Field:=1, _
Criteria1:="" & c1, Operator:=xlAnd, Criteria2:="<" & c2
End Sub



--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Krys" wrote in message
...
Hi, I want to filter a table of data to display rows with values between
two
numbers but the numbers will change as it is used, so the criteria values
have to be in the form of a formula.

ie.

A1 = Manually inputted data (eg 1)
B1 = Manually inputted data (eg 7)

A2 = A1
B2 = B1

F7 = "Day"
F8-F12 = Data (eg 2, 5, 1, 4, etc)
G7, H7 etc more data

How do I filter F7:H12 with the criteria that values in column F are =A2
and =<B2?


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
filtering based on a value in a cell John E. Fox Excel Worksheet Functions 1 December 13th 06 01:42 AM
filtering data based on a formula Al Z Excel Discussion (Misc queries) 1 July 13th 06 12:03 AM
data filtering based on last two digits of large number Margo Guda Excel Worksheet Functions 13 March 20th 06 03:22 AM
Filtering Data With Formula SteveC Excel Worksheet Functions 2 February 13th 06 08:39 PM
Filtering data from one worksheet based on another SKKB Excel Discussion (Misc queries) 2 April 15th 05 06:52 PM


All times are GMT +1. The time now is 04:27 AM.

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"