How to format a Spreadsheet control 9.0 at userform init?

vicber

Board Regular
Joined
May 21, 2004
Messages
91
Good day all,

I have this :

Dim R As Integer, C As Integer
With Spreadsheet1
For R = 1 To 30
For C = 1 To 10
.Cells(R, C).Value = Worksheets("PendingNO").Cells(R, C).Text
.Cells(1, C).Font.Bold = True ' Bold row 1
.Cells.AutoFitColumns ' obvious
.Cells.HAlignment = 2 ' center text in all cells
.Cells(1, 1).Select
Next C
Next R

@ the UserForm_Initialize sub
It does work well, but I want now to get spreadsheet1.[E1:I1] merged

I tried
Me.Spreadsheet1.Range("E1:I1").Select
Selection.Merge

I tried to
Dim SPM as Range
set SPM = [E1:I1] (as well as Me.Spreadsheet1. etc...)
SPM.Select
Selection.Merge

I tried
.cells(1,[6:10]).Select
Selection.Merge

no way!!!!!

I tried to record a macro to capture the steps generated with the PropertyToolBox (where we can merge a selection in the spreadsheet),but it
does not capture it

I'm lost here! can anyone help?

Thanks
Bernard
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top