Offset and Match together in VBA

  • The existing formulae that I have entered in the worksheet Sheet1 is as under : OFFSET(FullName,MATCH(HHselect,policyholderid,0)-1,0,1,1), FullName is the name for the range in Sheet2, HHSelect is the Cell Number D22 in worksheet1, policyholderid is the name for the range in Sheet2. I am now trying to write this code in VBA and am un sure of how to go about this. Looking forward with your replies.

  • Re: Offset and Match together in VBA


    Do you mean to add a formula using VBA?


    Like this?


    Code
    Sub InsertFormula()
    ActiveCell.FormulaR1C1 = "=Offset(FullName, Match(HHSelect, PolicyHolderID, 0) - 1, 0, 1, 1)"
    End Sub

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

  • Re: Offset and Match together in VBA


    Hello.. Thanks people... it worked like charm.. Pleasure.... :) Further, how to ensure that only the value/output is displayed in the active cell and not the entire formula?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!