Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Resultrange of Range.Find

Status
Not open for further replies.

waldemar

Programmer
Nov 15, 2001
245
DE
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" ....
 
it does better now that I found the error... (rng instead of rngResult). never mind and cheers to everyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top