View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Stuart WJG[_2_] Stuart WJG[_2_] is offline
external usenet poster
 
Posts: 22
Default find column letter

Hi
Understand first part but what is UDF ?

"Gary''s Student" wrote:

In A1 enter:

=col_id(A2,B1:AH6)


Where col_id is the following UDF:

Function col_id(r As Range, tbl As Range) As String
Dim d1 As Date, cel As Range
col_id = ""
d1 = r.Value
For Each cel In tbl
If cel.Value = d1 Then
col_id = Split(cel.Address, "$")(1)
Exit Function
End If
Next
End Function

--
Gary''s Student - gsnu200802


"Stuart WJG" wrote:

I need a formula that can look for a date in
a cell that matchs a date in a range and then enter column letter in the
formula cell
Formula in A1
Variable cell (date) A2
Range B1:ah6