• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Scrollbar value increasing using VBA

yande

New Member
Hi all Masters,

I want to make my scrollbar value increasing from 0 to 31 with formula +1.

I'd tried this coding but not work well.

>>> use code - tags <<<
Code:
Sub IncreaseValue()
Dim V As Integer

V = Sheet1.Range("A1")

Do Until V = 31

    Sheet1.Range("A1").Value = V + 1
   
Loop

End Sub
I want to make my scrollbar moving by its own with VBA.

Please help me. Thanks in advance.
 
Last edited by a moderator:

yande

New Member
yande
Hint: Your V's value will keep all the time same as it has been before Your loop.
but the value not increasing 1 by 1 until 31, it stop and i need to press esc to end the program.
For example, the V value is 0. When i run the code, it become 1 and not moving till 31.
 

vletm

Excel Ninja
yande
As I tried to give a hint ...
You set value for V ... once = one time ... V = Sheet1.Range("A1")
.... and ...
after that
You will add one to it (V) Sheet1.Range("A1").Value = V + 1
and
show it in Sheet1.Range("A1")
Your V-value do not change within Your look ... never!
You could 'track' it (V) eg with watch-option ... with Msgbox ... or so ...
I know ... guess ... what are You trying to do?
... but ...
Excel won't guess!
Excel will do - just as You have written.
ps. other minor thing ... after You can get above working ... it would do it fast! It would be very quickly 31!
 

yande

New Member
yande
As I tried to give a hint ...
You set value for V ... once = one time ... V = Sheet1.Range("A1")
.... and ...
after that
You will add one to it (V) Sheet1.Range("A1").Value = V + 1
and
show it in Sheet1.Range("A1")
Your V-value do not change within Your look ... never!
You could 'track' it (V) eg with watch-option ... with Msgbox ... or so ...
I know ... guess ... what are You trying to do?
... but ...
Excel won't guess!
Excel will do - just as You have written.
ps. other minor thing ... after You can get above working ... it would do it fast! It would be very quickly 31!
i dont get your hint actually, but i do understand about the result would be quickly 31. so i need to use time lapse coding which is i dont know how to make it.
and looks like my code would not working at all for my objective which is i want my scrollbar value increase from 0 to 31, with 1 second time elapse.
 
Top