if statement and variable last row
Results 1 to 4 of 4

Thread: if statement and variable last row
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    May 2004
    Posts
    397
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default if statement and variable last row

    Hi all,
    Formula in cell AN1
    if cell T5 is blank return last value in column AL, otherwise use user defined function to get result

    lr = Cells(Rows.Count, 38).End(xlUp).Row
    Range("AN1").FormulaR1C1 = _
    "=IF(R5C20="""",RC[-2] & lr,'abc def 2017.xlsm'!Ft_Uni2(R5C20))">
    will need to populate cells until last value in column AL is found.

    Thanks for any guidance, have a good day

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    26,976
    Post Thanks / Like
    Mentioned
    460 Post(s)
    Tagged
    45 Thread(s)

    Default Re: if statement and variable last row

    How about
    Code:
    "=IF(R5C20="""",R" & lr & "C[-2] ,'abc def 2017.xlsm'!Ft_Uni2(R5C20))"
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular
    Join Date
    May 2004
    Posts
    397
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: if statement and variable last row

    Thanks Fluff, code worked perfectly thanks

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    26,976
    Post Thanks / Like
    Mentioned
    460 Post(s)
    Tagged
    45 Thread(s)

    Default Re: if statement and variable last row

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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