Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Find header name

I have 7 columns and under them my data, each column has their own
data.
Row 2 contains the header names of the underlying data.
I'd to find, for instance, "metropol bus" on the sheet first and then
header name resides on the second row on the same column "buses".
How can I do this by vba ? Any hint or direction ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Find header name

Hope this helps! If so, let me know, click "YES" below.

Option Explicit

Sub GetHeaderName()

Dim HeadColumn As Long

HeadColumn = Sheets("Sheet1").Cells.Find(What:="metropol bus", _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False).Column

MsgBox "Header Name is - " & Sheets("Sheet1").Cells(2, HeadColumn)

End Sub
--
Cheers,
Ryan


"darkblue" wrote:

I have 7 columns and under them my data, each column has their own
data.
Row 2 contains the header names of the underlying data.
I'd to find, for instance, "metropol bus" on the sheet first and then
header name resides on the second row on the same column "buses".
How can I do this by vba ? Any hint or direction ?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Find header name

Couldn't find DOUBLE YES to click.
Thank you very much Ryan.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Autofilter Header range David Excel Programming 5 October 7th 09 01:34 PM
How do i find a picture that is in a header? Dave McD Excel Discussion (Misc queries) 3 April 20th 09 02:22 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Find Column to use based on Name of Header Otto Moehrbach Excel Programming 1 December 7th 06 08:32 PM
Find the first Value in a Row and Retrieve the Header for That Column efernandes67 Excel Discussion (Misc queries) 1 January 18th 06 10:23 PM


All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"