View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jacob Jacob is offline
external usenet poster
 
Posts: 61
Default 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.