LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
SiriS
 
Posts: n/a
Default How to merge cells in Word document by VBA code??


Hi,
sorry to bother you with this little problem...

I am writing a word document from Excel by VBA code, and in the word
document there is a table with two rows.

In the first table row, there are four cells, in the second row there
are five cells (after merging cell(1,1) and cell(1,2)). Now I want to
merge cell(1,4) and cell(2,5) into one. To do this I suppose I have to
select or activate the cells first(maybe not?), but how to?

I am trying to somehow define a range of cells, but have not succeeded
yet.. :(

This (bold text) seems not to be the correct syntax ??


Code:
--------------------
Set myTable = wordApp.ActiveDocument.Tables.Add(Range:=wordApp.S election.Range, NumRows:=2, _
NumColumns:=5, DefaultTableBehavior:=wdWord9TableBehavior)
....
...merging cell(2,1) and cell(2,2) and writing to cells..
....
*myTable.Range(myTable.cell(1, 4), myTable.cell(2, 5)).Select
Selection.Cells.Merge*
--------------------


Someone have a clue??

Best Regards
Siri


--
SiriS
------------------------------------------------------------------------
SiriS's Profile: http://www.excelforum.com/member.php...fo&userid=7995
View this thread: http://www.excelforum.com/showthread...hreadid=538814

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
troubleshoot merge cells - checked protection. Why is icon dim? Walter K Excel Discussion (Misc queries) 4 December 13th 05 03:14 PM
in an excel macro can you import data from word into a cell? Trefor Excel Discussion (Misc queries) 11 October 6th 05 01:49 PM
How to embed Word document into Excel and retain sizing, formatti. Kent Excel Discussion (Misc queries) 0 February 2nd 05 07:37 PM
Hyperlink to word document problem JS Links and Linking in Excel 0 December 8th 04 10:54 PM
getting specific info from a word document into excel smintey Excel Discussion (Misc queries) 3 December 8th 04 08:20 PM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"