+ Reply to Thread
Results 1 to 2 of 2

Inverse sliders, vlookup and cell referencing

Hybrid View

  1. #1
    Registered User
    Join Date
    10-03-2012
    Location
    Leicestershire UK
    MS-Off Ver
    Excel 2016
    Posts
    3

    Question Inverse sliders, vlookup and cell referencing

    Hi - any assistance greatly appreciated. Please see file attached.

    I have two sliders operating so that changing the value of one slider inversely changes the value of the other.
    I have done this by creating a vlookup function that picks out the inverse value I require from the appropriate table and then I make the slider linked cell equal the vlookup cell and Bob's your uncle - and in fact, he is my uncle!! ....anyway

    If I then use one of the sliders I can move it left and right quite happily and the other slider moves inversely. Great.

    The problem occurs when having used one slider, I try and move the other slider. Both the linked cell references to the vlookup cells break and the sliders cease to work in tandem.

    I cannot seem to get the cell reference from the linked cell to permanently look at the value created in the vlookup cell.

    I have tried everything I can think of without success. If anyone can help before I lose what's left of my hair I'd be very grateful.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,461

    Re: Inverse sliders, vlookup and cell referencing

    The linked cells for the scrollers can only contain a value and not a formula.
    Instead you need to hook into the scroller events.

    right click sheet tab and pick View code. Paste the following.
    Private m_blnUpdating As Boolean
    Private Sub ScrollBar1_Change()
    
        If m_blnUpdating Then Exit Sub
        
        m_blnUpdating = True
        ScrollBar2.Value = Range("L7")
        m_blnUpdating = False
        
    End Sub
    
    
    Private Sub ScrollBar1_Scroll()
    
        If m_blnUpdating Then Exit Sub
        
        m_blnUpdating = True
        ScrollBar2.Value = Range("L7")
        m_blnUpdating = False
    
    End Sub
    
    
    Private Sub ScrollBar2_Change()
    
        If m_blnUpdating Then Exit Sub
        
        m_blnUpdating = True
        ScrollBar1.Value = Range("L5")
        m_blnUpdating = False
    
    End Sub
    
    
    Private Sub ScrollBar2_Scroll()
    
        If m_blnUpdating Then Exit Sub
        
        m_blnUpdating = True
        ScrollBar1.Value = Range("L5")
        m_blnUpdating = False
    
    End Sub
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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