Ok this is the last one I promise
I am trying to locate COLUMNS by finding their Column Headers more specific their Text:
Function findLoc(strIntelliText As String, rng As Range) As Range
Dim rngResult As Range
Set rngResult = rng.Find(strIntelliText)
If rngResult Is Nothing Then
Set findLoc = Nothing
MsgBox "Loc not found"
Else
Set findLoc = rng
MsgBox "Loc found for " & strIntelliText & ": " & rngResult.Address & ", Column Nr. is: " & ????
End If
End Function
This function uses the Find method of the given range to find strIntelliText somewhere inside. My problem is that I want to use the result for locating the positio of the found cell on the whole wheet. So I am wondering if the result range somehow tells me in which Column (refereing to the whole sheet) the string was found.... resultrange.column get me nothing but "1" ....
I am trying to locate COLUMNS by finding their Column Headers more specific their Text:
Function findLoc(strIntelliText As String, rng As Range) As Range
Dim rngResult As Range
Set rngResult = rng.Find(strIntelliText)
If rngResult Is Nothing Then
Set findLoc = Nothing
MsgBox "Loc not found"
Else
Set findLoc = rng
MsgBox "Loc found for " & strIntelliText & ": " & rngResult.Address & ", Column Nr. is: " & ????
End If
End Function
This function uses the Find method of the given range to find strIntelliText somewhere inside. My problem is that I want to use the result for locating the positio of the found cell on the whole wheet. So I am wondering if the result range somehow tells me in which Column (refereing to the whole sheet) the string was found.... resultrange.column get me nothing but "1" ....