Results 1 to 1 of 1

Excel VBA - Find all occurances of value and insert formula to the right

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-06-2007
    Posts
    105

    Excel VBA - Find all occurances of value and insert formula to the right

    Hello,

    I'm looking for help with this macro. Currently it only finds the first occurance and then stops. I need it to find ALL occurances and insert the formula one cell to the right. Not sure if a Loop is needed here or if there is a better way to go about it.

    Dim r As Range
        Set r = ActiveSheet.Range("D1:D500").Find(What:="Live", LookAt:=xlPart)
        If Not r Is Nothing Then r.Offset(0, -1).Formula = "TEST"
    The formula i'm trying to insert is:

     Selection.FormulaArray = _
            "=IF(ISERROR(INDEX(R1C12:R500C12,MATCH(RC1&""Phone""&RC3,R1C7:R500C7&R1C10:R500C10&R1C11:R500C11,0))),0,INDEX(R1C12:R500C12,MATCH(RC1&""Phone""&RC3,R1C7:R500C7&R1C10:R500C10&R1C11:R500C11,0)))"


    Thanks
    Mike
    Last edited by adgjqetuo; 03-14-2013 at 11:17 AM.

Thread Information

Users Browsing this Thread

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

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.6.0 RC 1