Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / August 2007

Tip: Looking for answers? Try searching our database.

Column Name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt Russell - 29 Aug 2007 20:17 GMT
I need a formula to return the column name of the second occurence of
the heading "Q3 2007T".

Thanks
Bernard Liengme - 30 Aug 2007 01:40 GMT
This User Defined function does what you want. Call it with, for example,
=FIND2(A1:AZ1)

Function find2(myrange)
 For Each mycell In myrange
   If mycell.Value = "Q3 2007T" Then
     mycount = mycount + 1
   End If
   If mycount = 2 Then
     Set mc = mycell
     myaddress = mc.Address()
     Exit For
   End If
 Next
 If mycount < 2 Then
   find2 = "found " & mycount
 Else
   find2 = myaddress
 End If
End Function

New to VBA? See David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm
best wishes
Signature

Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

>I need a formula to return the column name of the second occurence of
> the heading "Q3 2007T".
>
> Thanks

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.