Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Merging cells in a table

I have a named range table of multiple 9 column rows and am using the
following code to load cells 5 and 9 in the j-th row of the table:
Sheets(ToSheet).Range(ToTable)(j, 5).Value = "aaa"
Sheets(ToSheet).Range(ToTable)(j, 9).Value = "bbb"
What code would merge cells 5 thru 9 of row j+1 to a single cell.

I appreciate your help, -John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Merging cells in a table

Worksheets(ToSheet).Range(ToTable)(j, 5).Resize(1, 5).Merge Across:=True

The Across parm is very nice if you wanted to merge multiple rows into multiple
cells (instead of looping through each row).

John wrote:

I have a named range table of multiple 9 column rows and am using the
following code to load cells 5 and 9 in the j-th row of the table:
Sheets(ToSheet).Range(ToTable)(j, 5).Value = "aaa"
Sheets(ToSheet).Range(ToTable)(j, 9).Value = "bbb"
What code would merge cells 5 thru 9 of row j+1 to a single cell.

I appreciate your help, -John


--

Dave Peterson
Reply
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
Merging two cells within the same table Phia Excel Programming 3 September 25th 08 01:15 AM
Table Merging jvbelg Excel Discussion (Misc queries) 3 September 17th 08 06:31 PM
Please Help with Two Table Merging wingale Excel Discussion (Misc queries) 1 April 15th 06 03:36 PM
Merging cells in Word Table from Excel Ex949 Excel Programming 0 January 4th 05 08:42 PM
Mail Merging a Table Herbert Stencil Excel Discussion (Misc queries) 1 December 20th 04 11:51 PM


All times are GMT +1. The time now is 12:27 AM.

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

About Us

"It's about Microsoft Excel"