简体   繁体   中英

Excel VBA: Connect Scrollbar and Textbox in Userform

I have a userform with a scrollbar and textbox.

How do you code it so that the scrollbar connects to the textbox?

For example, I want the textbox to increase/decrease by a value each time you click the up/down-arrow on the scrollbar.

You don't say what version of Excel you are using so see if this works for you.

To get a spinner or scrollbar to work you can connect it to a cell by right-clicking on the scroll bar control and selecting Properties | Format Control | Control Properties | Format Control | Control Properties | Format Control | Control and then select the cell by using the Cell Link property at the bottom to select and link the cell you want to increment/decrement by using the scrollbar

If you haven't already linked the textbox to that cell, you can do so by

  • First - select the text box
  • Second - put your cursor in the formula bar
  • Third - type in = symbol and then click on the above cell you want to link to,
  • Finally - press the Enter key

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM