VBA Cell.find

J

Jeff

Hello,

I need to design a VBA macro that would find "paid" in Column A and would
select in value in column H.
Ex:
Column A Column H
Paid $100.00
I need to select the $100.00
Regards
 
J

Jeff

Hi,
Technically, I'm going to use that worksheet that requires numbers not
formulas to be intergrated in a SAP application.
So I need a number.
Regards,
 
D

Dave Peterson

Record a macro when you do it once manually -- to get the settings correct for
the Find.

Option Explicit
Sub testme()

Dim FoundCell As Range
Dim FindWhat As String

FindWhat = "Paid"
With Worksheets("sheet1")
With .Range("a:a")
Set FoundCell = .Cells.Find(What:=FindWhat, _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
End With
End With

If FoundCell Is Nothing Then
MsgBox FindWhat & " wasn't found"
Else
Application.Goto FoundCell.Offset(0, 1)
End If

End Sub

I looked at xlPart and matchcase=false. Modify it as you need.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top