Hi,
I have placed a vertical scrollbar on my userform but when i run the form - the scrollbar appears but i am unable to move the scrollbar up and down to view the form? I thought this would be done easily...but...not really :confused:
Printable View
Hi,
I have placed a vertical scrollbar on my userform but when i run the form - the scrollbar appears but i am unable to move the scrollbar up and down to view the form? I thought this would be done easily...but...not really :confused:
scroll bars are not easy in vb, (i have never used one in vba)
in vb you have to write all the code to set the scale the scrollbar will move the form by, both clicking on the up and down arrows and clicking in bar for page moves.
try a google search on scrollbar vba, it will give a lot of hits
pete
oh damn!! and i thought that it was something relatively easy.
i believe it would probably be harder than saving settings
pete
Oh God!! :eek2: Didn't think it was that bad - already having problems with the temp save. I'm giving myself till tomorrow if i cant get temp saving and scrollbar working im jus going to leave it as is. Hate programming!!
post your whole project (document or spreadsheet) and i will try to have a look at it to help you out a bit (not do the whole thing for you though)
pete
no thats okay i am nearly done...just need to figure out how to work the scrollbar and save the temperature and light sensor settings...if i dont get it done i'll just hand in what i have.
Chaos:
Here's a way to force the View of an Excel Window to a particular cell:Of course the Ranged cell can be specified in the programmable syntax: Range(Cells(irow, icol))Code:'Select the Top Left cell before leaving and scroll the window
'This is the VERBOSE form of the command:
Application.GoTo Reference:=Range("A88"), Scroll:=True
'This is the TERSE form of the exact same command:
Application.GoTo Range("A88"), True
Good Luck and Good Learning!
Ahh..thanks Webtest but in using Word never used Excel. I think i may have found a work around though - didnt realise what a pain scrollbars were :)
On a whim, I looked up "GoTo" in the Word VBA Help Heap ... here are a few examples from that information that move the insert cursor:Good Luck and Good Learning.Code:'Jumps to the 4th line of the document (Absolute)
Selection.GoTo What:=wdGoToLine, Which:=wdGoToAbsolute, Count:=4
'Jumps ahead 20 lines in the document (Relative)
Selection.GoTo What:=wdGoToLine, Which:=wdGoToRelative, Count:=20
'Jumps back 6 lines in the document (Previous)
Selection.GoTo What:=wdGoToLine, Which:=wdGoToPrevious, Count:=6
Thanks Webtest for ur help but i've eliminated the use of scrollbar from my program.