First Question

  • Thread starter Thread starter Robert Couchman
  • Start date Start date
R

Robert Couchman

Hello,

here is the first question....

before i open up this form i would like the data for
combobox1 to look through spreadsheet in column "AX" and
display a list of any dates that appear in that column
(but only once if there is a date that appears more than
once)
then it will display the userform.

ANY HELP??

Thank you,

Robert Couchman
 
Robert,

Try something like the following code:

Dim Rng As Range
Dim V As Variant
Dim Coll As Collection
Set Coll = New Collection
Set Rng = Range("AX1")
On Error Resume Next
Do Until Rng.Value = ""
Coll.Add Rng.Text, Rng.Text
Set Rng = Rng(2, 1)
Loop
With UserForm1.ComboBox1
For Each V In Coll
.AddItem V
Next V
.ListIndex = 0
End With
UserForm1.Show


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Question number Two 1
Refresh Problem 1
Not sure if this is possible!! 4
Problem number One 9
Combobox update 1
Anyone can help 5
A constant update 1
Combobox 1

Back
Top