ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Data Filtering (https://www.excelbanter.com/excel-programming/335358-data-filtering.html)

Syed Haider Ali

Data Filtering
 

Dear Freinds.

I have a worksheet having lot of data. I need code for when i put a
particular data in cell "A1" of worksheet1, The filtered data will
automatically be copied in worksheet2.


Thanks

SYED HAIDER ALI


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=389679


William Benson[_2_]

Data Filtering
 
A few questions:

1) Are you manually entering the data in A1 or selecting a value using data
validation ... or perhaps would you prefer to use a combo box. Is the data
in A1 something which would be the value that would be found and filtered on
in the second worksheet, or just a triggering value?. ... and also, do you
want to copying to occur as soon as cell A1 changes or do you plan to
execute with, say, a button click?

2) Are you copying entire rows of filtered data in Worksheet2, or just
certain columns, where the filter occurs? And where are you copying it to?

It helps to be as clear as possible on requirements, which might explain why
no one has answered yet.

"Syed Haider Ali"
<Syed.Haider.Ali.1so2ad_1122195927.6019@excelfor um-nospam.com wrote in
message news:Syed.Haider.Ali.1so2ad_1122195927.6019@excelf orum-nospam.com...

Dear Freinds.

I have a worksheet having lot of data. I need code for when i put a
particular data in cell "A1" of worksheet1, The filtered data will
automatically be copied in worksheet2.


Thanks

SYED HAIDER ALI


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile:
http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=389679




Syed Haider Ali[_2_]

Data Filtering
 

Dear Willim Benson.

I want to enter the data in "A1" of Worksheet1 manually. Then, when i
click the command button it would be filter the data in worksheet1
according to "A1".

From this Filtered data of worksheet1 i need to copy selected colomns,
which would be paste into Worksheet2 at a given place (Suppose Start to
paste from "A3".)

Thanks

SYED HAIDER ALI


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=389679


William Benson[_2_]

Data Filtering
 
Here is one approach, which you can customize, but you will need code to
remove duplicate headers in your data if you are pasting more than once. Let
me know if you have any questions.

Regards,

Bill Benson
http://www.xlcreations.com


Private Sub CommandButton1_Click()
Dim Rng As Range
ActiveSheet.Range("DataRange").Select
Set Rng = Selection
ActiveSheet.AutoFilterMode = False
Rng.AutoFilter Field:=1, Criteria1:="=" & ActiveSheet.Range("A1").Value
Rng.CurrentRegion.Select
Rng.SpecialCells(xlCellTypeVisible).Select
Rng.Copy Sheets("Sheet2").Range("A" & _
Sheets("Sheet2").Cells(1).SpecialCells(xlCellTypeL astCell).Row _
+ 1)

End Sub


"Syed Haider Ali"
<Syed.Haider.Ali.1sprec_1122275114.6668@excelfor um-nospam.com wrote in
message news:Syed.Haider.Ali.1sprec_1122275114.6668@excelf orum-nospam.com...

Dear Willim Benson.

I want to enter the data in "A1" of Worksheet1 manually. Then, when i
click the command button it would be filter the data in worksheet1
according to "A1".

From this Filtered data of worksheet1 i need to copy selected colomns,
which would be paste into Worksheet2 at a given place (Suppose Start to
paste from "A3".)

Thanks

SYED HAIDER ALI


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile:
http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=389679




Syed Haider Ali[_3_]

Data Filtering
 

Dear William Benson

Thanks for your reply. I learn a lot of.

and how we can filter the data through comboBox.

thanks

Syed Haider Ali


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=389679


William Benson[_2_]

Data Filtering
 
No problem - there are always a lot of ways to accomplish things. Great you
learned something, I sure do every time I try to help someone, whether I hit
the target or not!


"Syed Haider Ali"
<Syed.Haider.Ali.1su8k7_1122484184.8426@excelfor um-nospam.com wrote in
message news:Syed.Haider.Ali.1su8k7_1122484184.8426@excelf orum-nospam.com...

Dear William Benson

Thanks for your reply. I learn a lot of.

and how we can filter the data through comboBox.

thanks

Syed Haider Ali


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile:
http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=389679





All times are GMT +1. The time now is 03:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com