texlnghorn
05-22-2006, 09:45 PM
I have read the msdn description of the Merge method and it is
straightforward in VB. However, I am programming in C# and the Merge method
takes 1 arguement which is a reference to the Across object. What are the
valid settings for the object?
Thanks,
Mike
Alvin Bruney
05-23-2006, 09:24 PM
Here is an example of the merge method
Sub Merge_Cells()
Dim ssConstants
Dim rngMerged
Set ssConstants = Spreadsheet1.Constants
' Merge cells B2:C5.
Spreadsheet1.ActiveSheet.Range("B2:C5").Merge
' Set a variable to the merged range.
Set rngMerged = Spreadsheet1.ActiveSheet.Range("B2").MergeArea
' Format the merged cell.
rngMerged.Borders.Color = "Red"
rngMerged.Borders.Weight = ssConstants.owcLineWeightThick
rngMerged.HorizontalAlignment = ssConstants.xlHAlignCenter
rngMerged.VerticalAlignment = ssConstants.xlVAlignCenter
End Sub
--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"texlnghorn" <texlnghorn@discussions.microsoft.com> wrote in message
news:23A105BC-A12B-4E22-92CB-9D567F6C413E@microsoft.com...
>I have read the msdn description of the Merge method and it is
> straightforward in VB. However, I am programming in C# and the Merge
> method
> takes 1 arguement which is a reference to the Across object. What are the
> valid settings for the object?
>
> Thanks,
> Mike