Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
In the range A1 - G20 I have values. Range A1 - A20 is called "products". In the other coloms there are values of each specific product. I would like to receive some help creating a userform with a ComboBox, labels and buttons. The ComboBox should -on change- display the values of the specific row in the labels. That is not the problem; I can do that. But also: I would like to create a button "next" and "previous". And when there is no possiblity to go back or further; the option must be disabled. Any help would be appriciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gert, I was just about to post a question asking how to change the
labels for specifics within a worksheet. Would you mind posting how you're doing that? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ComboBox1 - on change: value to range (Sheet2A1)
On sheet2 I get the values with a Excel-formula in a range On userform: get the values from Sheet2 "Craig" schreef in bericht ps.com... Gert, I was just about to post a question asking how to change the labels for specifics within a worksheet. Would you mind posting how you're doing that? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub ComboBox1_Change()
If ComboBox1.ListIndex = ComboBox1.ListCount Then CommandButton1.Enabled = False If ComboBox1.ListIndex = 1 Then CommandButton2.Enabled = False End Sub Private Sub CommandButton1_Click() 'Next Button Dim i As Long 'Index i = ComboBox1.ListIndex If i < ComboBox1.ListCount Then ComboBox1.ListIndex = i + 1 If i + 1 = ComboBox1.ListCount Then CommandButton1.Enabled = False Else CommandButton1.Enabled = False End If End Sub Private Sub CommandButton2_Click() 'Previous Button Dim i As Long 'Index i = ComboBox1.ListIndex If i 1 Then ComboBox1.ListIndex = i - 1 If i - 1 = 1 Then CommandButton2.Enabled = False Else CommandButton2.Enabled = False End If End Sub I think that would complete the task Die_Another_Day |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot.
But there is one thing: I didn't mention that it will be better to do it all in VBA. If there are non-unique items in my range, I will have a problem. "Die_Another_Day" schreef in bericht oups.com... Private Sub ComboBox1_Change() If ComboBox1.ListIndex = ComboBox1.ListCount Then CommandButton1.Enabled = False If ComboBox1.ListIndex = 1 Then CommandButton2.Enabled = False End Sub Private Sub CommandButton1_Click() 'Next Button Dim i As Long 'Index i = ComboBox1.ListIndex If i < ComboBox1.ListCount Then ComboBox1.ListIndex = i + 1 If i + 1 = ComboBox1.ListCount Then CommandButton1.Enabled = False Else CommandButton1.Enabled = False End If End Sub Private Sub CommandButton2_Click() 'Previous Button Dim i As Long 'Index i = ComboBox1.ListIndex If i 1 Then ComboBox1.ListIndex = i - 1 If i - 1 = 1 Then CommandButton2.Enabled = False Else CommandButton2.Enabled = False End If End Sub I think that would complete the task Die_Another_Day |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not Sure I understand what you're trying to say Gert. Please clarify if
you can Die_Another_Day |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you are also jgmiddel, then you have another response at your other thread.
Gert-Jan wrote: Hi, In the range A1 - G20 I have values. Range A1 - A20 is called "products". In the other coloms there are values of each specific product. I would like to receive some help creating a userform with a ComboBox, labels and buttons. The ComboBox should -on change- display the values of the specific row in the labels. That is not the problem; I can do that. But also: I would like to create a button "next" and "previous". And when there is no possiblity to go back or further; the option must be disabled. Any help would be appriciated. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Displaying cell values in a Userform | Excel Discussion (Misc queries) | |||
Userform for displaying values from a row | Excel Discussion (Misc queries) | |||
Displaying one userform from another | Excel Programming | |||
displaying picture in a userform | Excel Programming | |||
Displaying progress on UserForm | Excel Programming |