Hi
I have been wracking my brains and have come to a dead end. The idea is to click on a cell on Sheet 1(eg C7) and this will filter the second sheet based on the value of A7.
I have managed to do it for a single cell, and can click on any of the numbers in column C, but this filters the sheet based on the cell A7. What I need is if I click C13, it filters based on A13, or D13 =filter A13 on the second sheet.
The code I have is
------------------------------
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("C7:C32")) Is Nothing Then
Dim crit As String
crit = Sheets("FRONT").Range("A7").Value
Sheets("DATA").Select
With Worksheets("FRONT")
.AutoFilterMode = False
With .Range("E1:BH3000")
.AutoFilter
.AutoFilter Field:=48, Criteria1:=crit
End With
End With
End If
End If
End Sub
Any help would be appreciated.
I have been wracking my brains and have come to a dead end. The idea is to click on a cell on Sheet 1(eg C7) and this will filter the second sheet based on the value of A7.
I have managed to do it for a single cell, and can click on any of the numbers in column C, but this filters the sheet based on the cell A7. What I need is if I click C13, it filters based on A13, or D13 =filter A13 on the second sheet.
The code I have is
------------------------------
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("C7:C32")) Is Nothing Then
Dim crit As String
crit = Sheets("FRONT").Range("A7").Value
Sheets("DATA").Select
With Worksheets("FRONT")
.AutoFilterMode = False
With .Range("E1:BH3000")
.AutoFilter
.AutoFilter Field:=48, Criteria1:=crit
End With
End With
End If
End If
End Sub
Any help would be appreciated.