PDA

View Full Version : column



oleg_v
03-03-2010, 02:08 AM
Hello

how can identify the column name from the first cell in the column.
for example.

i have column "A" and the first cell is "feature"
i need a prompt window that will ask me the column name, i write "feature"
but variable will translate it to "A"


THANKS

Bob Phillips
03-03-2010, 02:52 AM
When you say that the first cellis feature, is this a defined name, or the value in the cell?

oleg_v
03-03-2010, 02:55 AM
CELLS VALUE

Bob Phillips
03-03-2010, 03:35 AM
Dim LookupValue As String
Dim ColNum As Long

LookupValue = inputbox("Search for what?")
On Error Resume Next
ColNum = Application.Match(LookupValue, Rows(1), 0)
On Error GoTo 0
If ColNum <> 0 Then

MsgBox Left$(Columns(ColNum).Address(True, False), InStr(Columns(ColNum).Address(True, False), ":") - 1)
End If