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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

yves_sater

New Member
Joined
Jul 29, 2010
Messages
15
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
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,871
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
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?
 

yves_sater

New Member
Joined
Jul 29, 2010
Messages
15

ADVERTISEMENT

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..
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,871
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
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.
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,871
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows

ADVERTISEMENT

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.
 

yves_sater

New Member
Joined
Jul 29, 2010
Messages
15
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
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,871
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
are we talking about Userform1?
which controls do you want to update with the spin button?
 

yves_sater

New Member
Joined
Jul 29, 2010
Messages
15
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..
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,109
Messages
5,857,443
Members
431,879
Latest member
KiwDaWabbit

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
Top