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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,147,507
Messages
5,741,566
Members
423,667
Latest member
Kai_357

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
Top