+ Reply to Thread
Results 1 to 20 of 20

Multiple formulas in one Cell with VBA

Hybrid View

  1. #1
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Multiple formulas in one Cell with VBA

    Try this and report back.

    Range("O2").Formula = "=MAX(A1:A20)&"" ""&MIN(A1:A20)"

  2. #2
    Registered User
    Join Date
    08-02-2012
    Location
    paris
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Multiple formulas in one Cell with VBA

    Quote Originally Posted by BigBas View Post
    Try this and report back.

    Range("O2").Formula = "=MAX(A1:A20)&"" ""&MIN(A1:A20)"
    Hello,

    Thank you for your answer.
    Great it works! but what did you do? Just add " and " ?

    Now would you do the same if the actual formula is:

    Range("O2").value= "=IF(LEN(D23)-LEN(SUBSTITUTE(D23,"[",""))>1,TRIM(MID(LEFT(D23,FIND("|",SUBSTITUTE(D23,"[","|",2))-1),FIND(">",D23)+1,255)),TRIM(MID(RIGHT(D23,FIND("|",SUBSTITUTE(D23,"<","|",1))+255),FIND(">",D23)+1,255)))"

    Thanks again!

    Edit: I used "," althought in my excel sheet I use ";" instead. I think in VBA "," should be used right?

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Multiple formulas in one Cell with VBA

    The easiest way to get the correct syntax is to use the macro recorder to generate the code for the formula.

+ 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