Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Autofilter based on user inputbox

Hi Clif & Garry,

Clif - some sample code would be greatly appreciated!

Garry - According to my stupid Google Groups, I don't have "another thread", so I never saw your answer! On a different note, what NG reader should I be using? Obviously the Google way is NOT the best!

Thanks!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Autofilter based on user inputbox

Steve wrote :
Hi Clif & Garry,

Clif - some sample code would be greatly appreciated!

Garry - According to my stupid Google Groups, I don't have "another thread",
so I never saw your answer! On a different note, what NG reader should I be
using? Obviously the Google way is NOT the best!

Thanks!!


You can use the news reader in your mail app if it has one. Outlook
Express, Live Mail, Mozilla Thunderbird to name a few.

Note that any MicroSoft news reader will purge the messges from your
local cache if nttp they subscribe to shuts down.

I use mesnews on my XP machine, mesnews or T-bird on my x64 Win7
machine.

You will, however, have to use a service that supports NTTP. I use the
one below my signature. You have to register with them but the service
is free.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Autofilter based on user inputbox

Garry,

Test...where did this show up??


On May 10, 7:32*pm, GS wrote:
Steve wrote :

Hi Clif & Garry,


Clif - some sample code would be greatly appreciated!


Garry - According to my stupid Google Groups, I don't have "another thread",
so I never saw your answer! *On a different note, what NG reader should I be
using? *Obviously the Google way is NOT the best!


Thanks!!


You can use the news reader in your mail app if it has one. Outlook
Express, Live Mail, Mozilla Thunderbird to name a few.

Note that any MicroSoft news reader will purge the messges from your
local cache if nttp they subscribe to shuts down.

I use mesnews on my XP machine, mesnews or T-bird on my x64 Win7
machine.

You will, however, have to use a service that supports NTTP. I use the
one below my signature. You have to register with them but the service
is free.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Autofilter based on user inputbox

Steve presented the following explanation :
Garry,

Test...where did this show up??


On May 10, 7:32*pm, GS wrote:
Steve wrote :

Hi Clif & Garry,


Clif - some sample code would be greatly appreciated!
Garry - According to my stupid Google Groups, I don't have "another
thread", so I never saw your answer! *On a different note, what NG reader
should I be using? *Obviously the Google way is NOT the best!
Thanks!!


You can use the news reader in your mail app if it has one. Outlook
Express, Live Mail, Mozilla Thunderbird to name a few.

Note that any MicroSoft news reader will purge the messges from your
local cache if nttp they subscribe to shuts down.

I use mesnews on my XP machine, mesnews or T-bird on my x64 Win7
machine.

You will, however, have to use a service that supports NTTP. I use the
one below my signature. You have to register with them but the service
is free.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Congrats! It shows up under the correct thread. Way to go...!

What did you do different?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Autofilter based on user inputbox

i tried the "quick and easy" method...I went to the OLD Google groups
site before they tried to get fancy with the new one!


On May 10, 8:03*pm, GS wrote:
Steve presented the following explanation :





Garry,


Test...where did this show up??


On May 10, 7:32 pm, GS wrote:
Steve wrote :


Hi Clif & Garry,


Clif - some sample code would be greatly appreciated!
Garry - According to my stupid Google Groups, I don't have "another
thread", so I never saw your answer! On a different note, what NG reader
should I be using? Obviously the Google way is NOT the best!
Thanks!!


You can use the news reader in your mail app if it has one. Outlook
Express, Live Mail, Mozilla Thunderbird to name a few.


Note that any MicroSoft news reader will purge the messges from your
local cache if nttp they subscribe to shuts down.


I use mesnews on my XP machine, mesnews or T-bird on my x64 Win7
machine.


You will, however, have to use a service that supports NTTP. I use the
one below my signature. You have to register with them but the service
is free.


--
Garry


Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Congrats! It shows up under the correct thread. Way to go...!

What did you do different?

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -

- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Autofilter based on user inputbox

I still didn't get your other response...did you tell me how to hide
and unhide columns?

On May 10, 8:06*pm, Steve wrote:
i tried the "quick and easy" method...I went to the OLD Google groups
site before they tried to get fancy with the new one!

On May 10, 8:03*pm, GS wrote:



Steve presented the following explanation :


Garry,


Test...where did this show up??


On May 10, 7:32 pm, GS wrote:
Steve wrote :


Hi Clif & Garry,


Clif - some sample code would be greatly appreciated!
Garry - According to my stupid Google Groups, I don't have "another
thread", so I never saw your answer! On a different note, what NG reader
should I be using? Obviously the Google way is NOT the best!
Thanks!!


You can use the news reader in your mail app if it has one. Outlook
Express, Live Mail, Mozilla Thunderbird to name a few.


Note that any MicroSoft news reader will purge the messges from your
local cache if nttp they subscribe to shuts down.


I use mesnews on my XP machine, mesnews or T-bird on my x64 Win7
machine.


You will, however, have to use a service that supports NTTP. I use the
one below my signature. You have to register with them but the service
is free.


--
Garry


Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Congrats! It shows up under the correct thread. Way to go...!


What did you do different?


--
Garry


Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Autofilter based on user inputbox

Steve wrote :
I still didn't get your other response...did you tell me how to hide
and unhide columns?


No, I just suggested you do that. Clif offered to provide code in the
thread he replied to and so I didn't dupe that.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Autofilter based on user inputbox

"Steve" wrote in message
...
Hi Clif & Garry,

Clif - some sample code would be greatly appreciated!



From the built-in help for Autofilter Object:
Use the AutoFilter property to return the AutoFilter object. Use the
Filters property to return a collection of individual column filters.
Use the Range property to return the Range object that represents the
entire filtered range. The following example stores the address and
filtering criteria for the current filtering and then applies new
filters.

I used that example code along with the macro recorder as my starting
point when beginning to work with autofilters.


Here's a code snippet from a macro I wrote when I needed to make certain
that "empty" cells were in fact empty:

(the worksheet already had an active autofilter range defined)

For x = 1 To 67 '67 columns
Selection.AutoFilter Field:=x, Criteria1:="=" 'Filter on Blank
Cells(5, x).EntireColumn.Select 'Select all but hidden
cells
Selection.ClearContents 'Delete contents
ActiveSheet.ShowAllData 'Show All Data
Next x
-------------

The next code snippet sets up an autofilter on a data sheet that drives
a chart sheet; based on user selection from a form. varMore() gives me
the flexibility to optionally add additional criteria for the
autofilter:

Sub MixChart(Mix As String, ParamArray varMore())
' ParamArray pairs = sort field, criteria
wbSaved = ActiveWorkbook.Saved 'unsaved changes?
'// I don't want to treat a change to the visible autofilter as a
change to the workbook '// but if there are other user changes I
want Excel to remember that!
With Worksheets("Data")
If Not .Range("D7").Value = Mix Or Mix = "Mix 3BF" Then
'// if the autofilter is already set correctly don't do it again
If .FilterMode Then .ShowAllData
'// When I wrote this I didn't use With / End With .... if I wrote
this
'// today I'd wrap this inside "With .Range("cylData").AutoFilter"
.Range("cylData").AutoFilter Field:=4, Criteria1:="=*" & Mix & "*", _
Operator:=xlAnd, Criteria2:="<*-*"
.Range("cylData").AutoFilter Field:=24, Criteria1:="<"
Select Case UBound(varMore)
Case 1
.Range("cylData").AutoFilter Field:=varMore(0), _
Criteria1:=varMore(1)
End Select
'// the End With would go here
.Range("D7").Value = Mix
End If
End With
If Not ActiveSheet.Name = "Chart1" Then Sheets("Chart1").Select
ActiveWorkbook.Saved = wbSaved 'restore previous state
End Sub
-----------------

To disable the autofilter conditions in a single column:

Range("cylData").AutoFilter Field:=4 'Cancel Location Filter
(the ShowAllData method cancels the filters in all columns)

----------------

I have other code that manipulates autofilters; just now I'm not
remembering just where I record a current definition for later use; but
this code along with the sample in the help should get you going. The
steps to copy the hidden data should be:



1. Record the current autofilter criteria
2. ShowAllData to reveal the hidded rows
3. Do your copy
4. Re-apply the autofilter criteria

All this should be done with screen updating turned off ... unless you
want the user to see all the scree updating happen. The macro is *much*
faster without the screen updating.


Post back if you need more specific help.


--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Autofilter based on user inputbox

"Steve" wrote in message
...
Hi Clif & Garry,

Clif - some sample code would be greatly appreciated!



From the built-in help for Autofilter Object:
Use the AutoFilter property to return the AutoFilter object. Use the
Filters property to return a collection of individual column filters.
Use the Range property to return the Range object that represents the
entire filtered range. The following example stores the address and
filtering criteria for the current filtering and then applies new
filters.

I used that example code along with the macro recorder as my starting
point when beginning to work with autofilters.


Here's a code snippet from a macro I wrote when I needed to make certain
that "empty" cells were in fact empty:

(the worksheet already had an active autofilter range defined)

For x = 1 To 67 '67 columns
Selection.AutoFilter Field:=x, Criteria1:="=" 'Filter on Blank
Cells(5, x).EntireColumn.Select 'Select all but hidden
cells
Selection.ClearContents 'Delete contents
ActiveSheet.ShowAllData 'Show All Data
Next x
-------------

The next code snippet sets up an autofilter on a data sheet that drives
a chart sheet; based on user selection from a form. varMore() gives me
the flexibility to optionally add additional criteria for the
autofilter:

Sub MixChart(Mix As String, ParamArray varMore())
' ParamArray pairs = sort field, criteria
wbSaved = ActiveWorkbook.Saved 'unsaved changes?
'// I don't want to treat a change to the visible autofilter as a
change to the workbook '// but if there are other user changes I
want Excel to remember that!
With Worksheets("Data")
If Not .Range("D7").Value = Mix Or Mix = "Mix 3BF" Then
'// if the autofilter is already set correctly don't do it again
If .FilterMode Then .ShowAllData
'// When I wrote this I didn't use With / End With .... if I wrote
this
'// today I'd wrap this inside "With .Range("cylData").AutoFilter"
.Range("cylData").AutoFilter Field:=4, Criteria1:="=*" & Mix & "*", _
Operator:=xlAnd, Criteria2:="<*-*"
.Range("cylData").AutoFilter Field:=24, Criteria1:="<"
Select Case UBound(varMore)
Case 1
.Range("cylData").AutoFilter Field:=varMore(0), _
Criteria1:=varMore(1)
End Select
'// the End With would go here
.Range("D7").Value = Mix
End If
End With
If Not ActiveSheet.Name = "Chart1" Then Sheets("Chart1").Select
ActiveWorkbook.Saved = wbSaved 'restore previous state
End Sub
-----------------

To disable the autofilter conditions in a single column:

Range("cylData").AutoFilter Field:=4 'Cancel Location Filter
(the ShowAllData method cancels the filters in all columns)

----------------

I have other code that manipulates autofilters; just now I'm not
remembering just where I record a current definition for later use; but
this code along with the sample in the help should get you going. The
steps to copy the hidden data should be:



1. Record the current autofilter criteria
2. ShowAllData to reveal the hidded rows
3. Do your copy
4. Re-apply the autofilter criteria

All this should be done with screen updating turned off ... unless you
want the user to see all the scree updating happen. The macro is *much*
faster without the screen updating.


Post back if you need more specific help.


--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Autofilter based on user inputbox

"Steve" wrote in message
...
i tried the "quick and easy" method...I went to the OLD Google groups
site before they tried to get fancy with the new one!

--------

Not the first time "new and improved" wasn't!

I'm also using the E-S NNTP service Garry mentioned ... I'm still on XP
and am using Outlook Express.

--
Clif

On May 10, 8:03 pm, GS wrote:
Steve presented the following explanation :





Garry,


Test...where did this show up??


On May 10, 7:32 pm, GS wrote:
Steve wrote :


Hi Clif & Garry,


Clif - some sample code would be greatly appreciated!
Garry - According to my stupid Google Groups, I don't have
"another
thread", so I never saw your answer! On a different note, what NG
reader
should I be using? Obviously the Google way is NOT the best!
Thanks!!


You can use the news reader in your mail app if it has one. Outlook
Express, Live Mail, Mozilla Thunderbird to name a few.


Note that any MicroSoft news reader will purge the messges from
your
local cache if nttp they subscribe to shuts down.


I use mesnews on my XP machine, mesnews or T-bird on my x64 Win7
machine.


You will, however, have to use a service that supports NTTP. I use
the
one below my signature. You have to register with them but the
service
is free.


--
Garry


Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Congrats! It shows up under the correct thread. Way to go...!

What did you do different?

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted
text -

- Show quoted text -





--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


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
Autofilter based on user inputbox Steve[_4_] Excel Programming 2 May 11th 11 01:30 AM
Autofilter based on user inputbox Steve[_4_] Excel Programming 1 May 10th 11 10:19 PM
Autofilter based on user inputbox Steve[_4_] Excel Programming 1 May 10th 11 06:14 PM
Autofilter based on user inputbox Steve[_4_] Excel Programming 1 May 10th 11 01:01 AM


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