Modify macro to find cells beginning with A - help needed
You did my corrected code, right?
--
Rick (MVP - Excel)
"Forum Freak" wrote in message
...
WOW!
That did it and far more. Rather than the message box I just want the
cell activating but many thanks anyway :o)
Kenny
"Rick Rothstein" wrote in message
...
Why have a button for each letter? Just use one button and ask the user
which column they want to search....
Sub FindInColumn()
Dim FindColumn As String, FoundCell As Range
FindColumn = Application.InputBox("What column?", _
"GetColumn Letter", Type:=2)
On Error Resume Next
Set FoundCell = Columns(FindColumn).Find(What:="a*", _
MatchCase:=False, After:=Cells(Rows.Count, _
FindColumn), SearchOrder:=xlColumns, _
LookAt:=xlPart, SearchDirection:=xlNext, _
LookIn:=xlValues)
If Not FoundCell Is Nothing Then
MsgBox "Cell " & FoundCell.Address & " starts with 'a' or 'A'."
Else
MsgBox "No cells in Column '" & FindColumn & "' start with 'a' or
'A'."
End If
End Sub
By the way, the user can specify the column either by its letter or
number designation.
--
Rick (MVP - Excel)
"Forum Freak" wrote in message
...
Hello
I have had no success Googling to find my answer so perhaps someone can
help me?
I recorded a macro involving "Find" and run it from a button. It works
but I want to modify it to only search column A and find the first word
beginning with the letter A.
From this I will be able to change the code to search for B etc. and
assign it to another button.
Any help would be appreciated.
Kenny W
Using XP Pro and Office 2003
|