eldarnegrin
New Member
- Joined
- Jul 9, 2013
- Messages
- 4
Hi,
I've seen here some code samples which worked for different people, yet i cant manage to make it work.
facts:
I've checked the trust vba module in the trust center.
cell A1 contains the filter value 1 (i want to show only rows that contain 1 in column a)
table data on range("A2:D6")/table:ListObject("Table1") (I've tried both)
a b c d
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
the code:
Nothing seems to work.. Thanks!
I've seen here some code samples which worked for different people, yet i cant manage to make it work.
facts:
I've checked the trust vba module in the trust center.
cell A1 contains the filter value 1 (i want to show only rows that contain 1 in column a)
table data on range("A2:D6")/table:ListObject("Table1") (I've tried both)
a b c d
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
the code:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not ActiveSheet.AutoFilterMode Then ActiveSheet.Range("A2:A6").AutoFilter [COLOR=#ff0000]'tried with ActiveSheet.AutoFilterMode=False too instead of this line[/COLOR]
Range("A2:A6").AutoFilter Field:=1, Criteria1:=Cells(1,1) [COLOR=#ff0000]'Tried with range here too instead of Cells reference, and also simple "1" as a static criteria[/COLOR]
End Sub
Nothing seems to work.. Thanks!