spin button help

yves_sater

New Member
Joined
Jul 29, 2010
Messages
15
i would like to do smthg like this:

Option Explicit

Private Sub ListBox1_Change()
Dim I As Integer
For I = 1 To 4
Me.Controls("TextBox" & I).Value = Range("A" & ListBox1.ListIndex + 2).Offset(, I)
Next I
End Sub

Private Sub SpinButton1_Change()
If ListBox1.ListIndex <> ListBox1.ListCount - 1 Then
ListBox1.ListIndex = SpinButton1.Value
Else
ListBox1.ListIndex = 0
SpinButton1.Value = 0
End If
End Sub
Private Sub UserForm_Initialize()
Dim LastRow As Long
LastRow = Range("A" & Rows.Count).End(xlUp).Row

ListBox1.RowSource = "A2:A" & LastRow

SpinButton1.Min = 0
SpinButton1.Max = LastRow

End Sub

by using only one spin button i can scroll down and up all vlaues of the textboxes and comboboxes that i have in my userform....can anyone help me plz
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
So all i nedd is by using only one spin button in a userform...i can scroll down and up all values in textboxes and comboboxes i have in this userform...
it can be if u want similar to a "Next" and "Previous" command button but because i have a lot of rows and datas..so the spin button will be easier for me to scrolldown adn up all the values i want till i reach the last value entered
 
Upvote 0
sorry but i think you did not provide enough information.
Where and what is the problem?
is it possible to provide the workbook (upload it somewhere public and post the link) or give more details?
 
Upvote 0
im gonna try to explain it...

i have a worksheet full with data with tiles such as:

PO# (A6) Item (B6) Supplier (C6)
Numbers(TXT) Name of the item(TXT) Name of suplier(Combo)

Project (D6) Delivery (E6) Project (F6)
Name of the project(Combo) Type of delivery (Combo) Name of the proejct (Combo)

i have a userform to be able to enter data in these fields

I want a spinbutton in this form ..instead of pushing on a next button...i want to scroll down and up the values in these Textboxes and comboboxes..
 
Upvote 0
yes i think i understand this
but i (and mybe everyone here) don't know just like this what is the problem with your code.
to test it is the best way, but for this i have to rebuild your file contents (more or less), your form with all controls, your code - and then see where is the problem.
it's much easier if we can all simply look at the file. i did send a PM with my e-mail.
if you send it to me i will upload it and then post the link to the file if you don't mind.
 
Upvote 0
not really sure but why don't try to replace
Private Sub SpinButton1_Change()
with
Private Sub SpinButton1_AfterUpdate()

i think i just got your mail - will check now.
 
Upvote 0
the formula i put in this threat at first, isnt included in my workbook...i got it from the internet and it does wat i want but it s not customized to my workbook
 
Upvote 0
are we talking about Userform1?
which controls do you want to update with the spin button?
 
Upvote 0
yes in userform1..i want all these textboxes and comboboxes...,,to be linked to one spinbutton that will have the function of Next and Previous..
 
Upvote 0

Forum statistics

Threads
1,214,388
Messages
6,119,226
Members
448,878
Latest member
Da9l87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top