Consulting

Results 1 to 5 of 5

Thread: Solved: Excel Concatentate formula...

  1. #1

    Solved: Excel Concatentate formula...

    This should be simple right. I found some examples regarding quotes in arrays but I can't seem to get the syntax to work for the lowly concatenate formula.

    I need to get the following written into a a cell in excel using VBA.

    =CONCATENATE(sizeDesc," (",width," x ",height," ",bleedVal,")","; ",detStockDesc,"; ",clicks1,"/",clicks2)
    Of course, all the quotes produce errors.


    Thanks in advance,
    David

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Generally, it is along the lines

    =cell &" some text" & another_cell

    but we need to know what your named ranges are to help more
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    They are all named ranges. The concatenate function in excel is being used to assemble a bunch of named ranges with spaces and punctuation. In Excel it works fine. It's the writing the statement into a cell using VBA that I'm tripping over. The result would look like the following: Ledger (11" x 17" ); 80# GLOSS TEXT; 4/4
    sizeDesc is Ledger, width is 11, height is 17, bleedVal is null, detStockDesc is 80# GLOSS TEXT, clicks1 is 4 and clicks 2 is 4.

    Thanks

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    ActiveCell.Formula = "=sizeDesc&"" (""&width&"" x ""&height&"" ""&BleedVal&"")""&""; ""&detStockDesc&""; ""&clicks1&""/""&clicks2"
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Worked like a charm!
    Thanks.
    Have to tuck that away for future use.

Posting Permissions

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