Can you embed a spreadsheet section on a userform that would interact via linking to the actual sheet to allow changes to the sheet?

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
918
Office Version
  1. 365
Platform
  1. Windows
This came from chatgpt minutes ago via a MrExcel post:

copied answer:
Yes, you can embed a section of a spreadsheet on a userform in Excel VBA. You can insert a worksheet control in your userform and establish various links with a real worksheet via Form/Worksheet Events. You can then display a range of cells in a user form, and allow the users to select cells (individually or a range as per usual with excel) and then copy and paste between them. You can also use the embedded worksheet for other purposes1.
Here is an example code that links all the data in the worksheet with the worksheet control when the userform is loaded:

Code:
Private Sub UserForm_Initialize ()
Dim addr As String
With Sheets(1)
addr = .UsedRange.Address
Spreadsheet1.Range(addr).Value = .UsedRange.Value
End With
End Sub
What ? - Maybe a long time ago with older Excel versions with toolboxes that had that control as an option. But it was clumsy at best.
Enlighten me if I’m missing something. That would be beyond cool if possible. :)

Thanks, cr
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I know at times Forms can be better than just making a form on a sheet, but I feel there is just so much more flexibility and formatting to build a form on a sheet.

. . . Then you have the native worksheet structure.
 
Upvote 0
In past years there were a multitude of address books, phone books etc in excel style with userforms to add, delete, change, append and whatever possibilities.
Maybe do a search and change to your requirements.
 
Upvote 0
I know at times Forms can be better than just making a form on a sheet, but I feel there is just so much more flexibility and formatting to build a form on a sheet.

. . . Then you have the native worksheet structure.
I'm going to try that and see if I can adapt it to my application.
Thanks for the tip.
cr
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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