+ Reply to Thread
Results 1 to 4 of 4

VBA Formula Question

  1. #1
    Barb Reinhardt
    Guest

    VBA Formula Question

    I have the following

    ActiveCell.FormulaR1C1 = _

    "=VLOOKUP(RC7,WorksheetPivot!R3:R7,MATCH(R1C,WorksheetPivot!R2),FALSE)"

    I want to change R7 to be variable based on the number of rows in the
    worksheet. I have a value for that which I'll call "lrow". What do I need
    to do to change the R3:R7 to R3:R &lrow?

    Thanks,
    Barb Reinhardt

  2. #2
    Niek Otten
    Guest

    Re: VBA Formula Question

    Hi Barb,

    "=VLOOKUP(RC7,WorksheetPivot!R3:R" & lrow &
    ",MATCH(R1C,WorksheetPivot!R2),FALSE)"

    --
    Kind regards,

    Niek Otten

    "Barb Reinhardt" <[email protected]> wrote in message
    news:[email protected]...
    >I have the following
    >
    > ActiveCell.FormulaR1C1 = _
    >
    > "=VLOOKUP(RC7,WorksheetPivot!R3:R7,MATCH(R1C,WorksheetPivot!R2),FALSE)"
    >
    > I want to change R7 to be variable based on the number of rows in the
    > worksheet. I have a value for that which I'll call "lrow". What do I
    > need
    > to do to change the R3:R7 to R3:R &lrow?
    >
    > Thanks,
    > Barb Reinhardt




  3. #3
    Niek Otten
    Guest

    Re: VBA Formula Question

    Without the linebreak of course

    --
    Kind regards,

    Niek Otten

    "Niek Otten" <[email protected]> wrote in message
    news:u94F%[email protected]...
    > Hi Barb,
    >
    > "=VLOOKUP(RC7,WorksheetPivot!R3:R" & lrow &
    > ",MATCH(R1C,WorksheetPivot!R2),FALSE)"
    >
    > --
    > Kind regards,
    >
    > Niek Otten
    >
    > "Barb Reinhardt" <[email protected]> wrote in
    > message news:[email protected]...
    >>I have the following
    >>
    >> ActiveCell.FormulaR1C1 = _
    >>
    >> "=VLOOKUP(RC7,WorksheetPivot!R3:R7,MATCH(R1C,WorksheetPivot!R2),FALSE)"
    >>
    >> I want to change R7 to be variable based on the number of rows in the
    >> worksheet. I have a value for that which I'll call "lrow". What do I
    >> need
    >> to do to change the R3:R7 to R3:R &lrow?
    >>
    >> Thanks,
    >> Barb Reinhardt

    >
    >




  4. #4
    Barb Reinhardt
    Guest

    Re: VBA Formula Question

    Thanks, I'll try that. I wasn't sure if I could do it that way.

    "Niek Otten" wrote:

    > Hi Barb,
    >
    > "=VLOOKUP(RC7,WorksheetPivot!R3:R" & lrow &
    > ",MATCH(R1C,WorksheetPivot!R2),FALSE)"
    >
    > --
    > Kind regards,
    >
    > Niek Otten
    >
    > "Barb Reinhardt" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have the following
    > >
    > > ActiveCell.FormulaR1C1 = _
    > >
    > > "=VLOOKUP(RC7,WorksheetPivot!R3:R7,MATCH(R1C,WorksheetPivot!R2),FALSE)"
    > >
    > > I want to change R7 to be variable based on the number of rows in the
    > > worksheet. I have a value for that which I'll call "lrow". What do I
    > > need
    > > to do to change the R3:R7 to R3:R &lrow?
    > >
    > > Thanks,
    > > Barb Reinhardt

    >
    >
    >


+ Reply to Thread

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