Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Change Filter

Hi,
I have been trying to get a filter to change depending on a number in a range.
Reason:
My worksheet has data that contains numbers from 60 to 70 in one of the
columns (Filtered) and If I was to enter 65 say, into my range (num_1) I then
want the macro to filter on 65.

My poor attempt showing what I think is the key part of the code

Number = Range("num_1").Value
Selection.AutoFilter Field:=5, Criteria1:=" & Number & "

For some reason it filters on CUSTOM

Any help greatly Appreciated
John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Change Filter

Try this

Number = Range("num_1").Value
Selection.AutoFilter Field:=5, Criteria1:=Number

--
Regards,
Tom Ogilvy

"JohnUK" wrote:

Hi,
I have been trying to get a filter to change depending on a number in a range.
Reason:
My worksheet has data that contains numbers from 60 to 70 in one of the
columns (Filtered) and If I was to enter 65 say, into my range (num_1) I then
want the macro to filter on 65.

My poor attempt showing what I think is the key part of the code

Number = Range("num_1").Value
Selection.AutoFilter Field:=5, Criteria1:=" & Number & "

For some reason it filters on CUSTOM

Any help greatly Appreciated
John

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Change Filter

Hello Tom
Ha - something as simple as that eh?
Many thanks - again
Best Wishes
Regards
John

"Tom Ogilvy" wrote:

Try this

Number = Range("num_1").Value
Selection.AutoFilter Field:=5, Criteria1:=Number

--
Regards,
Tom Ogilvy

"JohnUK" wrote:

Hi,
I have been trying to get a filter to change depending on a number in a range.
Reason:
My worksheet has data that contains numbers from 60 to 70 in one of the
columns (Filtered) and If I was to enter 65 say, into my range (num_1) I then
want the macro to filter on 65.

My poor attempt showing what I think is the key part of the code

Number = Range("num_1").Value
Selection.AutoFilter Field:=5, Criteria1:=" & Number & "

For some reason it filters on CUSTOM

Any help greatly Appreciated
John

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 change the font on auto filter? CFI Excel Discussion (Misc queries) 2 July 28th 09 04:32 PM
Use date modified to change format & create filter to track change PAR Excel Worksheet Functions 0 November 15th 06 09:17 PM
change position of filter button Jodie Excel Worksheet Functions 1 July 11th 06 10:07 PM
Capture Auto-Filter Change STEVE BELL Excel Programming 4 August 16th 05 01:36 AM
How do I run a filter then have my countif change? dtg_denver Excel Worksheet Functions 0 August 4th 05 04:26 PM


All times are GMT +1. The time now is 03:56 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"