Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Userform for displaying values from a row

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Userform for displaying values from a row

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Userform for displaying values from a row

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Userform for displaying values from a row

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Userform for displaying values from a row

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Userform for displaying values from a row

Not Sure I understand what you're trying to say Gert. Please clarify if
you can

Die_Another_Day

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Userform for displaying values from a row

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying cell values in a Userform michaelberrier Excel Discussion (Misc queries) 3 June 8th 06 05:24 PM
Userform for displaying values from a row jgmiddel Excel Discussion (Misc queries) 0 April 25th 06 09:00 PM
Displaying one userform from another CFD[_2_] Excel Programming 5 October 6th 05 06:18 AM
displaying picture in a userform Todd Huttenstine[_3_] Excel Programming 1 January 28th 04 02:42 AM
Displaying progress on UserForm Nigel Stevens Excel Programming 1 July 9th 03 01:55 PM


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"