Hi.
My code dont work excactly what I need!
How this problem solve?
Hi.
My code dont work excactly what I need!
How this problem solve?
Tad light on detail. What is it supposed to do?
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Every time if I click SpinButtonUp the Values in the cells (in Columns B) B2...B must change 10 times larger.
And if I click SpinButtonDown values must change 10 times smaller.
[vba]
Option Explicit
Sub AAA()
Dim LastRow As Long
Dim z As Range
LastRow = Range("A2").End(xlDown).Row
For Each z In Range("B2:B" & LastRow)
If z.Value = "" Then Exit For
z.Value = z.Value * 10
Next z
End Sub
Sub BBB()
Dim LastRow As Long
Dim z As Range
LastRow = Range("A2").End(xlDown).Row
If Range("H1").Value > 0 Then
For Each z In Range("B2:B" & LastRow)
If z.Value = "" Then Exit For
z.Value = z.Value / 10
Next z
End If
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Thanks XLD.
This good, but my problem is SpinButton wrong work.
If I begin run macrocode the Range B2.Value =3 & SpinButton LinkedCell i.e. RangeH1.Value=0 Ok
When I Click SB Up 1 time Range B2.Value=30 & SB Linked Cell i.e RangeH1.Value=1. OK
Now when I click SB Down LinkedCell Range H1.Value=0 i.e OK, but Range B2.Value30 That is problem???
This must be 3.
[vba]
Option Explicit
Private fZero As Boolean
Sub AAA()
Dim LastRow As Long
Dim z As Range
LastRow = Range("A2").End(xlDown).Row
For Each z In Range("B2:B" & LastRow)
If z.Value = "" Then Exit For
z.Value = z.Value * 10
Next z
fZero = False
End Sub
Sub BBB()
Dim LastRow As Long
Dim z As Range
If fZero Then Exit Sub
If Range("H1").Value = 0 Then
fZero = True
End If
LastRow = Range("A2").End(xlDown).Row
For Each z In Range("B2:B" & LastRow)
If z.Value = "" Then Exit For
z.Value = z.Value / 10
Next z
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
THANKS xld.
Works good.