Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Couldn't find DOUBLE YES to click.
Thank you very much Ryan. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Autofilter Header range | Excel Programming | |||
How do i find a picture that is in a header? | Excel Discussion (Misc queries) | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
Find Column to use based on Name of Header | Excel Programming | |||
Find the first Value in a Row and Retrieve the Header for That Column | Excel Discussion (Misc queries) |