ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   View cell range in userform (https://www.excelbanter.com/excel-programming/374339-view-cell-range-userform.html)

Jacob

View cell range in userform
 
Is is possible to view a range of cells in a userform?


moon[_7_]

View cell range in userform
 

"Jacob" schreef in bericht
ups.com...
Is is possible to view a range of cells in a userform?


In cel A1 you put 'Number', in B1 'Color'
A2: 1, B2: Red
A3: 2, B3: Green
A4: 3, B4: Blue
A5: 4, B5: Yellow
A6: 5, B6: Black


In VB Editor, insert a Userform, which is automatically called 'UserForm1'.
If you can't see the project's properties, then press the F4 button.

From the tools window, select a ListBox, which is automatically called
'ListBox1'.
In it's properties, you'll set ColumnCount to 2.
Also, set ColumnHeads to True
And finally, put the ListBox RowSource to: Sheet1!A2:B6


There u go.


Above is just a simple sample, of course you can also dynamically create the
RowSource using VBA, or use a ListView control or any kind of FlexGrid to
display your data.




Jacob

View cell range in userform
 
brilliant! thanks!


moon wrote:
"Jacob" schreef in bericht
ups.com...
Is is possible to view a range of cells in a userform?


In cel A1 you put 'Number', in B1 'Color'
A2: 1, B2: Red
A3: 2, B3: Green
A4: 3, B4: Blue
A5: 4, B5: Yellow
A6: 5, B6: Black


In VB Editor, insert a Userform, which is automatically called 'UserForm1'.
If you can't see the project's properties, then press the F4 button.

From the tools window, select a ListBox, which is automatically called
'ListBox1'.
In it's properties, you'll set ColumnCount to 2.
Also, set ColumnHeads to True
And finally, put the ListBox RowSource to: Sheet1!A2:B6


There u go.


Above is just a simple sample, of course you can also dynamically create the
RowSource using VBA, or use a ListView control or any kind of FlexGrid to
display your data.




All times are GMT +1. The time now is 04:16 PM.

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