#1   Report Post  
Murthy
 
Posts: n/a
Default Filter data

I want to filter the data on a sheet, basing on the value in a particular
cell - say A1.

What I have done so far is:
1) I have generated code to filter the list
2) I have provided a pick list in Cell A1
3) I have created a command button, clicking on which will execute the code
I mentioned in step (1) above.

Instead of clicking on the command button each time, is there a way to
filter the list, as soon as the value in Cell A1 is changed? Which event
should I use in my code for that?

Regards,
Murthy


  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi Murthy

You can use the change event to run your sub.
http://www.cpearson.com/excel/events.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Murthy" wrote in message ...
I want to filter the data on a sheet, basing on the value in a particular
cell - say A1.

What I have done so far is:
1) I have generated code to filter the list
2) I have provided a pick list in Cell A1
3) I have created a command button, clicking on which will execute the code
I mentioned in step (1) above.

Instead of clicking on the command button each time, is there a way to
filter the list, as soon as the value in Cell A1 is changed? Which event
should I use in my code for that?

Regards,
Murthy




  #3   Report Post  
Murthy
 
Posts: n/a
Default

Thanks, Ron.

Do you think Worksheet_Change event will work for me?

But how will I specify in the code that this Worksheet_Change event should
be triggered only when the value in cell A1 changes?

In other words, the filter should not be attempted by the code when the
cells (other than A1) change.

Regards,
Murthy




"Ron de Bruin" wrote in message
...
Hi Murthy

You can use the change event to run your sub.
http://www.cpearson.com/excel/events.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Murthy" wrote in message

...
I want to filter the data on a sheet, basing on the value in a particular
cell - say A1.

What I have done so far is:
1) I have generated code to filter the list
2) I have provided a pick list in Cell A1
3) I have created a command button, clicking on which will execute the

code
I mentioned in step (1) above.

Instead of clicking on the command button each time, is there a way to
filter the list, as soon as the value in Cell A1 is changed? Which

event
should I use in my code for that?

Regards,
Murthy






  #4   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi Murthy

Use this

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A1"), Target) Is Nothing Then
YourMacroName
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Murthy" wrote in message ...
Thanks, Ron.

Do you think Worksheet_Change event will work for me?

But how will I specify in the code that this Worksheet_Change event should
be triggered only when the value in cell A1 changes?

In other words, the filter should not be attempted by the code when the
cells (other than A1) change.

Regards,
Murthy




"Ron de Bruin" wrote in message
...
Hi Murthy

You can use the change event to run your sub.
http://www.cpearson.com/excel/events.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Murthy" wrote in message

...
I want to filter the data on a sheet, basing on the value in a particular
cell - say A1.

What I have done so far is:
1) I have generated code to filter the list
2) I have provided a pick list in Cell A1
3) I have created a command button, clicking on which will execute the

code
I mentioned in step (1) above.

Instead of clicking on the command button each time, is there a way to
filter the list, as soon as the value in Cell A1 is changed? Which

event
should I use in my code for that?

Regards,
Murthy








  #5   Report Post  
Murthy
 
Posts: n/a
Default

Ron,

Many thanks ..
I will try this code.

Regards,
Murthy


"Ron de Bruin" wrote in message
...
Hi Murthy

Use this

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A1"), Target) Is Nothing Then
YourMacroName
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Murthy" wrote in message

...
Thanks, Ron.

Do you think Worksheet_Change event will work for me?

But how will I specify in the code that this Worksheet_Change event

should
be triggered only when the value in cell A1 changes?

In other words, the filter should not be attempted by the code when the
cells (other than A1) change.

Regards,
Murthy




"Ron de Bruin" wrote in message
...
Hi Murthy

You can use the change event to run your sub.
http://www.cpearson.com/excel/events.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Murthy" wrote in message

...
I want to filter the data on a sheet, basing on the value in a

particular
cell - say A1.

What I have done so far is:
1) I have generated code to filter the list
2) I have provided a pick list in Cell A1
3) I have created a command button, clicking on which will execute

the
code
I mentioned in step (1) above.

Instead of clicking on the command button each time, is there a way

to
filter the list, as soon as the value in Cell A1 is changed? Which

event
should I use in my code for that?

Regards,
Murthy










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
Filter the way data is plotted Lars Charts and Charting in Excel 3 May 4th 05 01:38 PM
Inserting a hyperlink with "Data Filter" on, in Excel Bamff Excel Discussion (Misc queries) 3 March 16th 05 01:53 AM
How to make Bullen's FilterCriteria() data refresh real-time? Dennis Excel Discussion (Misc queries) 9 March 12th 05 09:41 PM
Running Data Table using an input that triggers DDE linked data [email protected] Excel Discussion (Misc queries) 1 December 16th 04 11:56 AM
Data Filter - Not all rows in spreadsheet will display in Autofilt Excel Help Excel Worksheet Functions 1 November 17th 04 05:40 PM


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