Thread: ComboBox Values
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default ComboBox Values

Private Sub CommandButton4_Click() 'Load Files
...
[Module1].CreateLists Worksheets("Analyzer")
....
End sub
_________________________________
Sub CreateLists(workingSheet as Worksheet)

Dim i, j, k, p, numberofRows As Integer
....

....
End Sub

as declared i, j, k, p are variants, not integers, not that it probably
makes any difference.

--
Regards,
Tom Ogilvy


"Jim Berglund" wrote in message
news:Y5tUc.134401$gE.417@pd7tw3no...
I am entering this subroutine from another sub, where the WorkingSheet

has
been defined
i.e
Private Sub CommandButton4_Click() 'Load Files
...
[Module1].CreateLists "Analyzer"
...
End sub
_________________________________
Sub CreateLists(workingSheet)

Dim i, j, k, p, numberofRows As Integer
...
(the aforementioned code)
...
End Sub

I tried your suggestion - both ways, but ran into additonal errors.

"Tom Ogilvy" wrote in message
...
is workingsheet a variable holding a reference to a set workingsheet =

Worksheets("Sheet1")

if so you can do

workingSheet.OleObjects("Combobox3").ListfillRange = _
Range(Cells(5, 112), Cells(p, 112))

I would prefer to see a qualification for the sheet holding the range as
well unless that sheet is the activesheet

set sh = Worksheets("Data")

workingSheet.OleObjects("Combobox3").ListfillRange = _
sh.Range(sh.Cells(5, 112), sh.Cells(p, 112))

--
Regards,
Tom Ogilvy

"Jim Berglund" <berglunj@ric
her.ca wrote in message news:yXrUc.131425$J06.21341@pd7tw2no...
I'm truing to change the values in a drop-down list box selector, but

the
following generates a Runtime Error 424 on the ComboBox line(s).

Is is possible to do what I want? What is the correct syntax, please?
__________________________________________________ ____________________
If Cells(5, 111).Value = "" Then
p = Cells(2, 114).Value
With WorkingSheet
ComboBox3.ControlFormat.ListFillRange = Range(Cells(5, 112),
Cells(p, 112))
End With
GoTo Equipment
Else
p = Cells(2, 118).Value
With WorkingSheet
ComboBox3.ControlFormat.ListFillRange = Range(Cells(5, 112),
Cells(p, 112))
End With
End If
_____________________________________

Thanks,
Jim Berglund