PDA

View Full Version : Auto-filter and select row



CathLavoie
10-13-2011, 05:17 AM
Hi!

I've been trying to create a macro for a specif need for 3 days, and can't find how...
Hope someone could help me here!

I would like to find and select the row in the column F of Sheet2 (called "Table1" in the macro) that contains the value of the cell F2 of the Sheet1.
Since there's a lot of data in the the column F of Sheet2, I'm using the auto-filter.

Here what I've done:

Range("F2").Select
Selection.Copy
Sheets("Sheet1").Select
Range("B2").Select
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=5, Criteria1:= _
Sheets("Sheet2").Range("F2"), Operator:=xlAnd
ActiveCell.Select

The macro does find the cell. But it did not select the cell - which is the most important because I need the row number! I want the "result cell" to be selected - I don't want to have a message box telling me the row number.

Could someone help me on this?

Thanks so much!