![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi fellas,
Set LastCell = Range("B65536").End(xlUp) Set CodeRange = Range(A2, LastCell). ListBox1.RowSource = "'Officer Code'!a2:b33" Need help with this... How do I define a range such that it starts from A2 and ends at LastCell ie the Set CodeRange line.. Then I want to set it as the RowSource to the ListBox... Any ideas guys?? Thanks |
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Set Lastcell = Range("B65536").End(xlUp)
Set CodeRange = Range("A2", Lastcell.Address) ListBox1.RowSource = CodeRange.Address Ivan |
|
|
|
|
|
#3 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Not eaxctly sure I have understood you but, try:
Sheet2.Range("A2", Sheet2.Range("B65536").End(xlUp)).Name = "MyRange" ListBox1.RowSource = "MyRange" |
|
|
|
|
|
#4 |
|
Guest
Posts: n/a
|
Cheers guys
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|