Macro to select one cell based on a value of another cell

Posted on 2011-10-30
Medium Priority
Last Modified: 2012-05-12
I need a macro that will find the cell that has a text value of "Summary Results", and then select the cell in column A, two rows below.  

So if "Summary Results" existed in C10, then cell A12 should be select.  I know the offset function holds part of the key to this.

Question by:KP_SoCal
LVL 24

Accepted Solution

StephenJR earned 2000 total points
ID: 37053848
I doubt you need to select, but anyway ...
Sub x()
Dim rFind As Range
With Sheet1
    Set rFind = .Cells.Find(What:="Summary Results", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
    If Not rFind Is Nothing Then
        .Cells(rFind.Row + 2, "A").Select
    End If
End With
End Sub

Open in new window


Author Closing Comment

ID: 37053949
Thank you!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question