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
917
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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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,223,880
Messages
6,175,152
Members
452,615
Latest member
bogeys2birdies

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