Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill combobox from specified range

I have a userform (userform1), with a combobox (combobox1) on it. When
start the userform from a sheet, the combobox should be filled with dat
from range A&:A200 in the same sheet. No dublicates should be added.

I have tried with the '.....userform1_initialize()', but nothing seem
to happen.

Can somebody give me the correct code.
Thnks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill combobox from specified range

A7 : A100

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill combobox from specified range

A small error. Should be range A6:A20

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill combobox from specified range

Private Sub UserForm_Initialize()


Dim num As Integer
Dim CellText
Dim Search

num = 6

Do
CellText = Range("A" & num).Value
Set Search = Range("A5:A" & num - 1).Find(CellText
LookIn:=xlValues)
'searches to see whether the text has shown up prior to curren
position
'if it's not found, it returns 'Nothing'
If Search Is Nothing Then
ComboBox1.AddItem CellText
End If
num = num + 1
Loop Until num = 200 ' Range("a" & num).Value = "" <<Use if you wan
it to go until the cell is blank




End Sub


-Gitcyphe

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill combobox from specified range

Worked like a charm.
Thnks

--
Message posted from http://www.ExcelForum.com

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
Fill a Combobox from a ROW? Rob[_5_] Excel Discussion (Misc queries) 4 January 15th 09 08:12 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
Fill a combobox karibou Excel Programming 2 January 27th 04 04:13 PM
ComboBox List Fill Range Dan Excel Programming 3 December 3rd 03 04:56 PM
Show one range in a combobox and write the 2nd range! Kevin Excel Programming 1 October 17th 03 05:52 AM


All times are GMT +1. The time now is 06:21 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"