Function WhichColumn(myStr)
Application.Volatile 'can remove if not using
'this function as a worksheet function
Set dd = Cells.Find(What:=myStr, After:=Cells(Cells.Rows.Count, _
Cells.Columns.Count), LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not dd Is Nothing Then WhichColumn = _
dd.Column Else WhichColumn = "Not found"
End Function
Use in a worksheet formula thus:
=WhichColumn("First assign time")
and in vba code thus:
x = WhichColumn("First assign time")
or
y = "First Assign time"
x= WhichColumn(y)