is there a command in vba that i can use in a user form to scroll up or down?

rholdren

Board Regular
Joined
Aug 25, 2016
Messages
140
Office Version
  1. 365
  2. 2019
Just a quick question about scrolling in a user form. I am just looking for a command that I can use in a userform that allows a user to click on a button and scroll to the top of the page. I've been reading all over the place that sendkeys are a nasty little thing and everybody has a thousand options with massive amounts of coding and placing that code in a separate sub but I was just curious if there was a command in vba like there is in a macro

for example in a macro for the sheet I could have ActiveWindow.SmallScroll Down:=84

but that won't work on a userform. Is there something that replaces ActiveWindow when using a userform? I'm just curious. In my attempt to develop my skills I keep looking at things that seem to be common issues with excel and vba. Usually here you can find a simple easy to diagnose solution to the problem. But in researching the sendkey issue nobody bothered to ask the question I did above.

Any thoughts? no need to post any code I was just curious. Thanks
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I was just curious if there was a command in vba like there is in a macro
Macros use VBA and VBS as the coding language in Excel. The SmallScroll, ScrollRow and ScrollColumn methods are all avaiable in both.
 
Upvote 0

Forum statistics

Threads
1,215,872
Messages
6,127,430
Members
449,382
Latest member
DonnaRisso

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