ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Display Worksheet Range in a Textbox (https://www.excelbanter.com/excel-discussion-misc-queries/162767-display-worksheet-range-textbox.html)

roadkill

Display Worksheet Range in a Textbox
 
I want to display a range of data from a Worksheet on a user form. From what
I read in "help", it sounds like a textbox should be able to do this. But
I've tried a few things (e.g. unsuccessfully tried to set ControlSource to
the range that I want) and can't seem to make it work.

How do I display a range of cells (or even Worksheet, if that's the only
option) on a user form?

Thanks,
Will

Bernie Deitrick

Display Worksheet Range in a Textbox
 
Will,

Used a listbox on your userform, and use code like

Private Sub UserForm_Initialize()
Me.ListBox1.List = Range("NameORAddressOfRange").Value
End Sub

Set the column count of the listbox to the number of columns that are in your range that you want to
show.

HTH,
Bernie
MS Excel MVP


"roadkill" wrote in message
...
I want to display a range of data from a Worksheet on a user form. From what
I read in "help", it sounds like a textbox should be able to do this. But
I've tried a few things (e.g. unsuccessfully tried to set ControlSource to
the range that I want) and can't seem to make it work.

How do I display a range of cells (or even Worksheet, if that's the only
option) on a user form?

Thanks,
Will





All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com