Adding options to a Combo box using variables located in a spreadsheet

S

Steven

hello....

I'm having trouble trying to add a list of options that are kept in a
spreadsheet to a combo box on my form.

The easiet way I can see is by declaring a variable, that variable
being the column in which my options are found. After that my brain has
gone to mush (I'm new to all this)

anyone any ideas?
 
J

Jonathan West

Hi Steven

This sounds like an Excel question. This group deals with VBA in Word. The
Excel VBA experts hang out at microsoft.public.excel.programming. You are
more likely to get an informed answer there.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
S

Steven

I believe it is VBA question as I'm trying to write the code that drags
the list in my spreadsheet into the combo box.

The reason I'm holding the list within a column in excel is purely so
it can be easily changed as requirements change in the future.

There is a section of code on the same form to take the weeks from the
same sheet as follows,


Private Sub userform_initialize()


Dim WeekList As String, icount As Integer

icount = 2

While Worksheets("Variables").Range("A" & icount).Value <> ""

WeekList = Worksheets("Variables").Range("A" & icount).Value

cboWeek.AddItem WeekList

icount = icount + 1

Wend

End Sub

The other data I have is in column G but my changes aren't working.
;-((
 
S

Stefan Blom

But it is an *Excel* VBA question, not a *Word* VBA question -- and
therefore it should be asked in an Excel programming newsgroup.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 

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

Top