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:
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
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
Enlighten me if I’m missing something. That would be beyond cool if possible.
Thanks, cr