Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a user form with a combobox. I don't know much about writing code,
but i would like the ref list (range) to prettymuch be col B starting at row 7 - however i don't want everything in that col. I just want everything with a number, no blanks or text. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This has not been tested, but should be OK. If not, post back with any error
messages received. Open the VB editor, right click on the userform name and click view code in the pop up menu. Paste the code below into the code window for the form. When you use the UserForm1.Show in the standard code module1, it should load your combo box. Private Sub UserForm_Initialize() Dim lr As Long, i As Long lr = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row With ActiveSheet For i = 7 To lr If .Cells(i, 2) < "" And IsNumeric(.Cells(i, 2)) Then Me.ComboBox1.AddItem .Cells(i, 2) End If Next End With End Sub "KUMPFfrog" wrote: I have a user form with a combobox. I don't know much about writing code, but i would like the ref list (range) to prettymuch be col B starting at row 7 - however i don't want everything in that col. I just want everything with a number, no blanks or text. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great!!! Thanks so much
Now how do I make this numeric list show as assending? "JLGWhiz" wrote: This has not been tested, but should be OK. If not, post back with any error messages received. Open the VB editor, right click on the userform name and click view code in the pop up menu. Paste the code below into the code window for the form. When you use the UserForm1.Show in the standard code module1, it should load your combo box. Private Sub UserForm_Initialize() Dim lr As Long, i As Long lr = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row With ActiveSheet For i = 7 To lr If .Cells(i, 2) < "" And IsNumeric(.Cells(i, 2)) Then Me.ComboBox1.AddItem .Cells(i, 2) End If Next End With End Sub "KUMPFfrog" wrote: I have a user form with a combobox. I don't know much about writing code, but i would like the ref list (range) to prettymuch be col B starting at row 7 - however i don't want everything in that col. I just want everything with a number, no blanks or text. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See if this site can help you with that:
http://support.microsoft.com/kb/227178 "KUMPFfrog" wrote: Great!!! Thanks so much Now how do I make this numeric list show as assending? "JLGWhiz" wrote: This has not been tested, but should be OK. If not, post back with any error messages received. Open the VB editor, right click on the userform name and click view code in the pop up menu. Paste the code below into the code window for the form. When you use the UserForm1.Show in the standard code module1, it should load your combo box. Private Sub UserForm_Initialize() Dim lr As Long, i As Long lr = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row With ActiveSheet For i = 7 To lr If .Cells(i, 2) < "" And IsNumeric(.Cells(i, 2)) Then Me.ComboBox1.AddItem .Cells(i, 2) End If Next End With End Sub "KUMPFfrog" wrote: I have a user form with a combobox. I don't know much about writing code, but i would like the ref list (range) to prettymuch be col B starting at row 7 - however i don't want everything in that col. I just want everything with a number, no blanks or text. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
JLGWhiz
i was hoping you could help me again. this time i want to populate a combobox based on this criteria: column "n" only if coresponding value in column "s" matches textbox.value "JLGWhiz" wrote: This has not been tested, but should be OK. If not, post back with any error messages received. Open the VB editor, right click on the userform name and click view code in the pop up menu. Paste the code below into the code window for the form. When you use the UserForm1.Show in the standard code module1, it should load your combo box. Private Sub UserForm_Initialize() Dim lr As Long, i As Long lr = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row With ActiveSheet For i = 7 To lr If .Cells(i, 2) < "" And IsNumeric(.Cells(i, 2)) Then Me.ComboBox1.AddItem .Cells(i, 2) End If Next End With End Sub "KUMPFfrog" wrote: I have a user form with a combobox. I don't know much about writing code, but i would like the ref list (range) to prettymuch be col B starting at row 7 - however i don't want everything in that col. I just want everything with a number, no blanks or text. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
combobox value < range | Excel Programming | |||
ComboBox Range | Excel Programming | |||
Combobox to range | Excel Programming | |||
Show one range in a combobox and write the 2nd range! | Excel Programming | |||
ComboBox.Value To Range | Excel Programming |