Forum Discussion
Ravindu94
May 29, 2019Brass Contributor
to change range of the macro
i use bellow macro to auto filter my data on "Stock Detail" sheet. i have some numbers in my "ID" sheet and i use bellow to filter data of stock detail sheet. here with data about ID numbers in the sheet "ID" Column "ID info" Cell "D2" . how can i set the range doe D column (ID Info)
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
With Worksheets("Stock Detail")
.Select
.Range("A4").AutoFilter Field:=1, Criteria1:=Target.Value
End With
End Sub
1 Reply
- BerndvbatankerIron Contributor
Hi ,
try this
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
With Worksheets("Stock Detail")
.Select
.Range("A:D").AutoFilter Field:=4, Criteria1:=Target.Value
End With
End SubRegards
Bernd
http://www.vba-tanker.com