I’ve tried various different ways to achieve what I’m trying to do.
What I am trying to do is establish if “FrwD + 2” of the filtered range contains a string starting with “To*”
ie “To whoever”
The code below is not right but the nearest I’ve come up with, it is returning the ACTUAL FrwD + 2 of the HIDDEN filtered range; NOT the FrwD + 2 row of the VISIBLE range.
I am making a hash of this; can someone give me some guidance?
What I am trying to do is establish if “FrwD + 2” of the filtered range contains a string starting with “To*”
ie “To whoever”
The code below is not right but the nearest I’ve come up with, it is returning the ACTUAL FrwD + 2 of the HIDDEN filtered range; NOT the FrwD + 2 row of the VISIBLE range.
I am making a hash of this; can someone give me some guidance?
VBA Code:
Public Sub WhichFilter()
Option Explicit
Option Compare Text
Dim sht As Worksheet
Dim rng As Range
Dim FrwD As Long
Set sht = ThisWorkbook.ActiveSheet
Set rng = Range("AK:AK").Find(what:="Paid", LookIn:=xlValues, LookAt:=xlWhole)
FrwD = rng.Row
If Not Left(CStr(Range("AS" & FrwD + 2)), 2) = "To*" Then 'This is giving FrwD + 2 of HIDDEN filtered range and NOT the FrwD + 2 of the visible first range
MsgBox "Your attempting to use the WRONG Sub on this filter - Abort macro", vbOKOnly Or vbCritical, Application.Name
Exit Sub
End If
If true continue sub…….