DDE Merge Cells (Excel)

Reply
New Contributor
Posts: 4

DDE Merge Cells (Excel)

I have some cells that I need to merge in an Excel worksheet via DDE. All I've seen so far is to use:

put '[alignment(7, false,3,0)]';

after selecting the cells I want to merge. This doesn't seem to merge the cells correctly as they are still all separate cells.

Can anyone provide some additional code that would be the equivilent of the "Merge and Center" toolbar command in Excel?

Many Thanks!

Occasional Contributor
Posts: 12

Re: DDE Merge Cells (Excel)

If you have the dde reference connect to the excel system, the alignment statement will center and merge:

filename dde_sys dde 'excel|system';

data _null_;

file dde_sys ;

put '[select("r2c5:r2c6")]';

put '[alignment(7)]';

run;

filename dde_sys clear;

Ask a Question
Discussion stats
  • 1 reply
  • 847 views
  • 0 likes
  • 2 in conversation