PDA

View Full Version : Solved: Excel Concatentate formula...



Papadopoulos
09-08-2010, 02:13 PM
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.
:banghead:

Thanks in advance,
David

Bob Phillips
09-08-2010, 04:16 PM
Generally, it is along the lines

=cell &" some text" & another_cell

but we need to know what your named ranges are to help more

Papadopoulos
09-09-2010, 07:56 AM
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

Bob Phillips
09-09-2010, 08:04 AM
ActiveCell.Formula = "=sizeDesc&"" (""&width&"" x ""&height&"" ""&BleedVal&"")""&""; ""&detStockDesc&""; ""&clicks1&""/""&clicks2"

Papadopoulos
09-09-2010, 10:05 AM
Worked like a charm!
Thanks.
Have to tuck that away for future use.