Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Trouble populating ComboBox from a range

How do I get this to work?


Private Sub UserForm_Activate()

X = 0
Do While Range("CPSBs").Offset(X, 0).Value < ""
Me.ComboBox1.AddItem (Range("CPSBs").Offset(X, 0).Value)
X = X + 1
Loop


End Sub

I am not sure how to do this at all.

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Trouble populating ComboBox from a range

It is not all too clear but maybe this

Private Sub UserForm_Activate()

For Each cell In Range("CPSBs").Offset(X, 0)
If cell.Value < "" Then
Me.ComboBox1.AddItem cell.Value
End If
Next cell

End Sub


--
---
HTH

Bob


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



wrote in message
...
How do I get this to work?


Private Sub UserForm_Activate()

X = 0
Do While Range("CPSBs").Offset(X, 0).Value < ""
Me.ComboBox1.AddItem (Range("CPSBs").Offset(X, 0).Value)
X = X + 1
Loop


End Sub

I am not sure how to do this at all.

thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Trouble populating ComboBox from a range

You're a genius. Exactly what I wanted. Thanks
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Trouble populating ComboBox from a range


Dim cell As Range
For Each cell In Range("CPSBs")
Me.ComboBox1.AddItem cell.Value
Next cell
Set cell = Nothing

" wrote:

How do I get this to work?


Private Sub UserForm_Activate()

X = 0
Do While Range("CPSBs").Offset(X, 0).Value < ""
Me.ComboBox1.AddItem (Range("CPSBs").Offset(X, 0).Value)
X = X + 1
Loop


End Sub

I am not sure how to do this at all.

thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble loading a range into a comboBox Janis Excel Programming 5 January 17th 08 03:33 PM
Populating Combobox WLMPilot Excel Programming 17 March 28th 07 03:07 AM
Populating a combobox WLMPilot Excel Programming 1 March 12th 07 08:07 PM
Populating a ComboBox DirInfo Excel Programming 1 March 17th 05 10:03 PM


All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"