Results 1 to 8 of 8

Evaluate Formula Syntax in VBA code

Threaded View

  1. #1
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Evaluate Formula Syntax in VBA code

    Hi

    I have this line of code containing an Evaluate Formula:

    vstrIDs = Join(Application.Transpose(Evaluate("IF(" & .Address & "<>"""",MID(" & .Address & ",2,5),"" "")")), " ")
    I need to replace the 5 with this formula, translated to replace C174 to .Address, as appropriate and getting the syntax right.

    MID(C174,2,FIND("^^",SUBSTITUTE(C174,"-","^^",2))-FIND("-",C174)+1)
    I am having trouble with all the damned double quotes...

    One of my unsuccessful attempt:

    vstrIDs = Join(Application.Transpose(Evaluate("IF(" & .Address & "<>"""",MID(" & .Address & ",2,MID(" & .Address &" ,2,FIND(""^^""",SUBSTITUTE(" & .Address & ",""-"",""^^"",2))-FIND(""-""," &.Address & ")+1)),"" "")")), " ")
    Thanks.
    Last edited by NBVC; 05-03-2010 at 04:21 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

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