Thread: UserForm specs
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1974_] Rick Rothstein \(MVP - VB\)[_1974_] is offline
external usenet poster
 
Posts: 1
Default UserForm specs

Tell me about it. I've been touch-typing for many, many years now and, when
not looking at the keyboard, I still tend to overshoot the quote mark key
for the Enter key more often than not. The odds that I would have been able
to touch-type the Array function assignment statement you posted, short as
it was, without missing the quote mark key at least once is nearly nil.

Rick


"Bob Phillips" wrote in message
...
Good point, they must be the most annoying character on the keyboard.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Rick Rothstein (MVP - VB)" wrote in
message ...
In addition to the Array function method Bob posted, there is this
alternative (which, if you are like me and hate typing multiple quote
marks if you can help it) you might want to consider...

Private Sub UserForm_Activate()
ComboBox1.List = Split("Item 1,Item 2,Item 3,Item 4,Item 5", ",")
End Sub

where you can use any delimiter character you want so long as it is not
in any of the items in the list.

Rick


"alex" wrote in message
...
On May 19, 8:25 am, "Bob Phillips" wrote:
Private Sub UserForm_Activate()
Dim aryValues As Variant

aryValues = Range("A1:A20")
Me.ComboBox1.List = aryValues
End Sub

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"alex" wrote in message

...
On May 19, 7:33 am, Incidental wrote:

Hi Alex

The code below would be one way to do it.

Private Sub UserForm_Initialize()

TextBox1.Value = Format(Now, "YYYY - MM - DD")

End Sub

Hope this helps

Steve

Thanks Bob and Steve; it worked perfectly. While I've got your
attention...Do you know the best way to add a list to a combobox? I'm
currently using .AddItem, but with a long list, it's a bit tedious.

thanks again,
alex


Thanks again Bob...I'd like to not reference anything on the
worksheet. I'm assuming I can still set up some kind of array.
aryValues = ?