View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Corey Corey is offline
external usenet poster
 
Posts: 363
Default Combobox List to list Numerical Values ONLY in Column A is specifi

Thank you for the reply John.
I placed the below code in the required section as:

Private Sub UserForm_Activate()
Dim lastrow As Integer
Dim myRow As Integer
lastcell = Cells(Rows.Count, "A").End(xlUp).Row
myRow = 2
Do Until myRow = lastcell
If IsNumeric(Cells(myRow, 1)) = True And Cells(myRow, 1) < "" Then
ComboBox1.AddItem (Cells(myRow, 1))
myRow = myRow + 1
End If
Loop
End Sub

But the Userform is White with no text and Freezes up Excel. Must Exit
Excelt to get rid of White Userform ??

Corey....


"John Bundy" remove X''''''''''''''''s wrote in
message ...
See if this does what you are asking, on the userformactivate paste this,
it
will add all numbers in column A and thats it.

Private Sub UserForm_Activate()
Dim lastrow As Integer
Dim myRow As Integer

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

Do Until myRow = lastcell

If IsNumeric(Cells(myRow, 1)) = True And Cells(myRow, 1) < "" Then
ComboBox1.AddItem (Cells(myRow, 1))
myRow = myRow + 1
Loop
End Sub

--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"Corey" wrote:

I am setting up a userform and have placed a Combobox on it.
I want it to list Numerical values ONLY from a sheet named "Data Sheet
for
Inspections", in Colum "A".

As data is input the Column and over time, there will only be a text
value
of "Roll#" AND an Numerial Value Custom Formatted as "#123". IE. Hash in
front of the value.

There will be a 3 digit numerical value every 25 rows or so, and a text
value of "Roll#" above it,
ALL other cells in Column "A" will be left blank.

So, is ther a way to fill the combobox with ONLY the numerical values in
this sheet in column A, EXCLUDING the Text AND EMPTY Cells ?

How ?

Corey....