+ Reply to Thread
Results 1 to 6 of 6

Scrollbar to have two different linked cells

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Scrollbar to have two different linked cells

    Hello,

    I have a VBA module that creates a scrollbar that I need to link to a cell on another worksheet within the same workbook. I also wish for the value of the scroll bar to be seen next to the scroll bar itself.

    Is there a way to link to two different cells via one scrollbar. Or, alternatively, how can I link to one of the cells and then create a cell reference within my module to link to another cell? When I've done this second option the link only updates the numbers when I rerun the macro and not when I move the scrollbar.

    Thank you for any help you may give.

    Matt

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Scrollbar to have two different linked cells

    There is no direct way to link a scrollbar to two cells, but it can be done in VBA with the Scrollbar_Click event, which can simply update the second cell every time the value changes. But:

    Quote Originally Posted by gruberm View Post
    Or, alternatively, how can I link to one of the cells and then create a cell reference within my module to link to another cell? When I've done this second option the link only updates the numbers when I rerun the macro and not when I move the scrollbar.
    Maybe I don't understand your question. When I create a scrollbar and set LinkedCell to B1, then cell B1 updates every time I move the scrollbar. I also put a formula in A1 that says

    =B1

    and it also updates when I move the scrollbar. (However, and this may be obvious, if I type a number in B1 it will cause the scrollbar to be updated as well. If I do that in A1, it just overwrites the formula and breaks the link.)

    Also, you don't give a clue as to what your macro does or your goal in having two cells linked to one scrollbar. Sometimes if we understand the whole problem we can improve your whole solution.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Scrollbar to have two different linked cells

    Thank you for the response. TO answer your question the goal of the scrollbar is to provide a value to a cell on a different worksheet where it will be used in some operations. However I wish to have the value displayed on the worksheet containing the scrollbar so the user knows the value that is being input.

    One complexity might be that these scrollbars are added to and removed from the page via a spinner control that determines the amount of criteria to be evaluated.

    I hope that helps.

  4. #4
    Registered User
    Join Date
    11-05-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Scrollbar to have two different linked cells

    Thank you for the response. TO answer your question the goal of the scrollbar is to provide a value to a cell on a different worksheet where it will be used in some operations. However I wish to have the value displayed on the worksheet containing the scrollbar so the user knows the value that is being input.

    One complexity might be that these scrollbars are added to and removed from the page via a spinner control that determines the amount of criteria to be evaluated.

    I hope that helps.

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Scrollbar to have two different linked cells

    *deleted post*

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Scrollbar to have two different linked cells

    Quote Originally Posted by gruberm View Post
    ...the goal of the scrollbar is to provide a value to a cell on a different worksheet where it will be used in some operations. However I wish to have the value displayed on the worksheet containing the scrollbar so the user knows the value that is being input.
    Then the solution I described is perfect. You set the LinkedCell value of the scrollbar to a cell on the worksheet where the scrollbar is being displayed. On the other worksheet, simply use a formula that refers to the linked cell.

    One complexity might be that these scrollbars are added to and removed from the page via a spinner control that determines the amount of criteria to be evaluated.
    That goes beyond your original question. It doesn't affect my answer but your code will have to create these linked cells and formulas each time it creates a new scrollbar based on the spinner.

    If you have more questions then I would need to see your file.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1