Display sheet in userform

ApolloID

Well-known Member
Joined
Jun 8, 2010
Messages
769
Hi, can a macro display the content of a sheet in an userform?
I have excel 2007.

Can this be done?
Thanks!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If you right click on the Userform Toolbox and select Additional Controls you can choose a Spreadsheet control to add.

Dom
 
Upvote 0
Hi, i found microsoft office spreadsheet 11.0 and now it,s working.
I am using this formula:
Code:
Private Sub UserForm_Initialize()
Me.Spreadsheet1.Cells.Range("A1:Q43").Value = ThisWorkbook.Worksheets("Sheet2").Range("A1:Q43").Value
End Sub

It,s ok, but it's not keeping sheet's format.

Can this be done?
Thanks!
 
Upvote 0
You could copy and paste:

Code:
Private Sub UserForm_Initialize()

ThisWorkbook.Worksheets("Sheet1").Range("A1:Q43").Copy

Me.Spreadsheet1.Cells.Range("A1").Paste

End Sub

To be honest I've never really thought of a good reason for using a worksheet control in a userform so don't know much about the limitations of them.

Dom
 
Upvote 0

Forum statistics

Threads
1,223,738
Messages
6,174,213
Members
452,551
Latest member
croud

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