determine the column where a cell was found

  • Thread starter Thread starter usadream
  • Start date Start date
U

usadream

Hi all,

I have a find that returns the range of a cell where the search-value
is found. does anyone know how i can determine the column where this
cell is located?


Code:
--------------------
Set teamNameRng = searchRng.Find(What:=tempTeamName, _
After:=startRng, _
Lookat:=xlWhole, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)
--------------------


Than a lot in advance
regards
thomas
 
Hi,

thanx a lot for your reply:
now ur solution returns my the number of the column, but in the end,
what i need is defining a range in this column, so for e.g. if


Code:
--------------------
myCol = teamNameRng.Column
--------------------
--> myCol = 11

then i should be able to define a range like this:


Code:
--------------------
Set destrange = activeSheet.Range("myCol7 : myCol146")
--------------------

where 7 and 146 are start and end rows..

does anyone know the syntax for this?

help apreciated, thanx
thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top