View Full Version : Merging cells in Excel 2000 through Access VB


trickster
02-22-2006, 07:09 AM
Hi I need to know how do I merge cells on an Excel Spreadsheet, using a VB program to generate the spreadsheet, nad to merge the cells. I am using Access 2000 and Excel 2000. Can anybody help me please?

fuzzygeek
02-23-2006, 08:25 AM
This is code taken from my application. The first group shows how I defined the spreadsheet in access, the second shows how to merge cells:

Process_Begin:
'Dimension the application, the workbook, the worksheets
'the column and row titles; the column and row data
Dim objXL As Excel.Application
Dim wbXL As Excel.Workbook
Dim wsXLValues As Excel.Worksheet
Dim wsXLCCS As Excel.Worksheet

'Merge cells in CCS Spreadsheet (sheet2)
wsXLCCS.Range("G1:I1").MergeCells = True
wsXLCCS.Range("J1:L1").MergeCells = True
wsXLCCS.Range("M1:O1").MergeCells = True

trickster
02-27-2006, 06:11 AM
Thanks I'll give that a try