Hello -
Could someone please tell me how to wrap text within merged cells? A simple example:
tell application "Microsoft Excel"
activate
make new workbook at beginning
tell workbook 1
tell window 1 to set view to normal view
tell worksheet 1
merge range "B4:D4"
--set wrap text of cell 2 of row 4 to true -- this wraps just within first cell
--set wrap text of range "B4:D4" to true -- this doesn't do anything
set value of cell 2 of row 4 to "Four score and seven years ago our fathers brought forth..."
end tell
end tell
end tell
I’ve found VBA solutions that involve steps something like:
- calculate total width of range
- set leftmost cell to that width
- autofit the entire row
- set leftmost cell back to its original width
- merge the cells
- play with the row height somehow
or some permutation of those steps, but nothing I’ve tried works and it can’t be that complicated.
Thanks very much…
- Dan