PC Review


Reply
Thread Tools Rate Thread

combobox on userform not populating ??

 
 
Corey
Guest
Posts: n/a
 
      28th Dec 2006
The below code posted by a fellow user to assist me is suppose to populate a
combobox with ONLY values in Column A in sheet named(InspectionData).

However i do NOT get any values in the combobox dropdownlist.

Do i need to add something to the RowSource ??



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub UserForm_Initialize()

Dim lastcell As Long
Dim myRow As Long

lastcell = Cells(Rows.Count, "A").End(xlUp).Row

With ActiveWorkbook.workSheets("InspectionData")
For myRow = 2 To lastcell
If .Cells(myRow, 1) <> "" Then
If IsNumeric(.Cells(myRow, 1)) = True Then
Me.ComboBox1.AddItem .Cells(myRow, 1)
End If
End If

Next myRow
End With

End Sub

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Corey....


 
Reply With Quote
 
 
 
 
Corey
Guest
Posts: n/a
 
      28th Dec 2006
John,
No i get NO error.
When i click on the list button, i simply GET Nothing listed.
The Sheet(InspectionData) at the moment is completely blank, EXCEPT for a
value of 499 in cell(A2).

So according to the code, i should get a 499 in the combobox1 list, should i
not ?

Corey....

"John Bundy" <(E-Mail Removed) remove X''''''''''''''''s> wrote in
message news5EF619E-D0B3-4249-8F42-(E-Mail Removed)...
> This works for me, are you getting an error?
>
> Private Sub UserForm_Initialize()
>
> Dim lastcell As Long
> Dim myRow As Long
>
> lastcell = Worksheets("inspectiondata").Cells(Rows.Count,
> "A").End(xlUp).Row
>
> With ActiveWorkbook.Worksheets("InspectionData")
> For myRow = 2 To lastcell
> If .Cells(myRow, 1) <> "" Then
> If IsNumeric(.Cells(myRow, 1)) = True Then
> ComboBox1.AddItem Cells(myRow, 1)
> End If
> End If
>
> Next
> End With
>
>
> End Sub
>
> --
> -John Northwest11
> Please rate when your question is answered to help us and others know what
> is helpful.
>
>
> "Corey" wrote:
>
>> The below code posted by a fellow user to assist me is suppose to
>> populate a
>> combobox with ONLY values in Column A in sheet named(InspectionData).
>>
>> However i do NOT get any values in the combobox dropdownlist.
>>
>> Do i need to add something to the RowSource ??
>>
>>
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Private Sub UserForm_Initialize()
>>
>> Dim lastcell As Long
>> Dim myRow As Long
>>
>> lastcell = Cells(Rows.Count, "A").End(xlUp).Row
>>
>> With ActiveWorkbook.workSheets("InspectionData")
>> For myRow = 2 To lastcell
>> If .Cells(myRow, 1) <> "" Then
>> If IsNumeric(.Cells(myRow, 1)) = True Then
>> Me.ComboBox1.AddItem .Cells(myRow, 1)
>> End If
>> End If
>>
>> Next myRow
>> End With
>>
>> End Sub
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>
>> Corey....
>>
>>
>>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Populating worksheet from userform combobox =?Utf-8?B?TWFydGluIEZpc2hsb2Nr?= Microsoft Excel Programming 0 13th Jan 2007 11:53 PM
Populating a ComboBox in a UserForm I Maycotte Microsoft Excel Programming 2 27th Jun 2006 06:28 PM
Populating Userform ComboBox with worksheet names in XL2003 =?Utf-8?B?TUFXSUk=?= Microsoft Excel Programming 1 9th Aug 2005 09:37 PM
Populating data on userform gki Microsoft Excel Programming 6 29th Jul 2004 07:35 AM
Re: Populating a VBA UserForm Danny Sowden Microsoft Excel Programming 0 19th Aug 2003 03:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:51 AM.