Ive created a sheet with 10000 lines of data, summarized by many criteria through many countifs.
Im looking for a way to 'click' on a count if result, and have a new sheet open up that will give me the rows and their data, that compile that countif result.
Ive tried the following VBA of which i am not the author....
Sub SummarizeCountif()
Dim rngSel As Range
Dim rng As Range
Dim rngPrec As Range
If TypeName(Selection) <> "Range" Then Exit Sub
Set rngSel = Selection
On Error Resume Next
Application.ScreenUpdating = False
For Each rng In rngSel
Set rngPrec = Nothing
If InStr(1, rng.Formula, "CountIf", vbTextCompare) = 2 Then
Set rngPrec = rng.DirectPrecedents
If rngPrec.Cells.Count = 1 Then Set rngPrec = Nothing
If rngPrec Is Nothing Then
rng.ShowPrecedents
rng.NavigateArrow TowardPrecedent:=True, ArrowNumber:=1
Set rngPrec = Selection
rng.Parent.Activate
End If
rng.Hyperlinks.Add Anchor:=rng.Offset(, 1), _
Address:="", _
SubAddress:=rngPrec.Address(0, 0, External:=True), _
TextToDisplay:="Go to the source range"
ActiveSheet.ClearArrows
End If
Next rng
On Error GoTo 0
End Sub
My source data is contained in A25:AJ11000 (Labels in Row 24)
Attachment 466117
Bookmarks