+ Reply to Thread
Results 1 to 2 of 2

Thread: Find Text in Formula

  1. #1
    Registered User
    Join Date
    02-24-2011
    Location
    Brighton, England
    MS-Off Ver
    Excel 2003
    Posts
    19

    Find Text in Formula

    Hi there

    I have a sheet that processes a macro upon a worksheet change event. When a cell is changed on one sheet, a picture of a persons signature (jpg) is inserted on another sheet. I can specify the cell that I want the jpg to appear easily enough, however I want the function to search for some text "Yours Sincerely" and insert the picture at that cell. The problem comes in that the "Yours Sincerely" appears as part of a formula (it is based on an 'If' formula), so when I search for it, it can't find it. So I need it to find the value of the cell. Any ideas anyone?

    Thanks

    Neil

  2. #2
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,228

    Re: Find Text in Formula

    Try something like:

    Sub FindYS()
    '
    ' C6 contains:   ="x "&F9&" y"
    ' F9 contains:   Yours Sincerely
    
    MsgBox Cells.Find(What:="Yours Sincerely", _
        After:=ActiveCell, _
        LookIn:=xlValues, _
        LookAt:=xlPart, _
        SearchOrder:=xlByRows, _
        SearchDirection:=xlNext, _
        MatchCase:=False, _
        SearchFormat:=False).Address
    End Sub

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0