• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Excel VBA to display column letter of a certain string

How can I  (with VBA not formula) return the column letter where a certain string is found in row 1?

So for example column letter where the string "Specialized" is found in row 1?

A string appears only once.

1 Solution
You don't need VBA, but ...
Sub x()
Dim rFind As Range
With Rows(1)
    Set rFind = .Find(What:="specialized", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
    If Not rFind Is Nothing Then
        MsgBox Split(rFind.Address, "$")(1)
    End If
End With
End Sub

Open in new window

BrdgBldrAuthor Commented:
:o) thank u!

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now