Merging cells in a table

J

John

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
 
D

Dave Peterson

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).
 
Top