View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JaMark JaMark is offline
external usenet poster
 
Posts: 7
Default Finding the right column

Thanks Norman, that's just what I need :o)


Norman Jones wrote:
Hi JaMark,

Try something like:

'=============
Public Sub Tester()
Dim rng As Range
Dim col As Long

With ActiveSheet
On Error Resume Next
Set rng = .Cells.Find(What:="Line*", _
After:=.Range("A1"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)
End With
On Error GoTo 0

If Not rng Is Nothing Then MsgBox rng.Column

End Sub
'<<=============


--
---
Regards,
Norman



"JaMark" wrote in message
oups.com...
I have a row, that looks like this:

| Fender bb | Fender ee | Fender ff | Line 1 |

Now, the number of fender columns could vary, so my question is, how do
I get the column number/letter of the column that contains "Line" as
the first four letters (because it is not always line 1)?