ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA Cell.find (https://www.excelbanter.com/excel-discussion-misc-queries/1671-vba-cell-find.html)

Jeff

VBA Cell.find
 
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



Frank Kabel

Hi
why not use application.vlookup?

--
Regards
Frank Kabel
Frankfurt, Germany

Jeff wrote:
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




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,

"Frank Kabel" wrote:

Hi
why not use application.vlookup?

--
Regards
Frank Kabel
Frankfurt, Germany

Jeff wrote:
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





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

Jeff wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 09:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com