List Range in Userform Listbox

SimpleSimon88

New Member
Joined
Jan 15, 2014
Messages
19
Hi again.
I am trying to find/work out how to list a range within a listbox

I can get it to work on a worksheet using Active X listbox (As it has an option for FillRange)

All I'm needing is my range displayed on a userform

example names:
Userform1
Range1

Thanks

(Image to follow to show what I mean) ...
 

Some videos you may like

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

puru.sve

Active Member
Joined
Apr 29, 2010
Messages
292
use this like code ..


Private Sub UserForm_Initialize()
UserForm1.ListBox1.AddItem Range("A1:A2").Address
End Sub
 

SimpleSimon88

New Member
Joined
Jan 15, 2014
Messages
19

ADVERTISEMENT

Just to solve confusion....


This returns just the range array ($B$3:$Q$5001)

This returns the above when I've altered the code to suit my code to...


Code:
[COLOR=#333333]Private Sub UserForm_Initialize()[/COLOR]
[COLOR=#333333]UserForm1.ListBox1.AddItem Range("Range1").Address[/COLOR]
[COLOR=#333333]End Sub

R[/COLOR][COLOR=#333333]ange1 =[/COLOR][COLOR=#333333] ($B$3:$Q$5001)

[/COLOR]

Simon
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,465
Office Version
  1. 365
Platform
  1. Windows
Try:

Code:
Private Sub UserForm_Initialize()
With Me.ListBox1
    .List = Range("Range1").Value
    .ColumnCount = Range("Range1").Columns.Count
End With
End Sub
 

puru.sve

Active Member
Joined
Apr 29, 2010
Messages
292
ActiveSheet.Shapes("List Box 1").ControlFormat.List

this is for user form ...

Your problem is solved or it still persist ?

Let me know
</pre>
 

Watch MrExcel Video

Forum statistics

Threads
1,123,318
Messages
5,600,925
Members
414,416
Latest member
Nobu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top