+ Reply to Thread
Results 1 to 5 of 5

is splitting a formula possible in VBA?

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    95

    is splitting a formula possible in VBA?

    So I have this 1220 character long beast of a formula and i'm trying to use VBA to execute it into the cell it looks something like this...


    Please Login or Register  to view this content.
    As most of you all may know... Once I paste this formula onto my VBA code both lines just become red.

    Is there a way to do this simpler or possibly break down the formula in half?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    The problem might not be the length of the formula.

    You need to double up all the quotes.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-15-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: is splitting a formula possible in VBA?

    Sorry I forgot to mention(and add it on there) that I did double up the quotes.

    So when I try putting that formula in.... it automatically goes on the VBA as two lines. Even if I tried to widen my VBA window to max width(since I'm using multiple screens), I can't seem to add anything else on the first line.

    So when I try to break up the formula by adding "_" at the end of the line and splitting it... the code just doesn't work and breaks.

    any idea?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: is splitting a formula possible in VBA?

    As far as I can see the quotes haven't been doubled up.

    For example "STAFF" should be ""STAFF"".

    Anyway to continue a string on the next line use & _ .
    Please Login or Register  to view this content.
    PS Have you tried shortening the formula?

  5. #5
    Registered User
    Join Date
    01-15-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: is splitting a formula possible in VBA?

    Cool. Thanks.

    I just made the formula shorter by referencing column numbers instead of using headers. hehehe

+ 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