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

Posted on 2011-10-30
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

    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

    Thank you!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    This article will show you how to use shortcut menus in the Access run-time environment.
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
    Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now