title: VBA: Created Mouseover Code that works. Need to Show/Hide Columns based on Mouseover
body: <p>I've created a mouseover macro, that when moused over certain cells, changes the value in the linked cell, [Expanded_Rollover], to either be "View Expanded Details" or "View Data Filters". From this linked cell, based on either of the above values, I want to create code that either hides or reveals columns "O:S" of my dashboard. I have a code that works for hiding and revealing the columns alone, but I can't link the two codes to work at once on just the mouseover. PLEASE HELP!!</p>
  
  <pre><code>Public Function ExpandedRollover(Expanded_Options As String)
  
      'Cell Expanded Rollover = Moused over cell value in Expanded_Options Range - Values are 1 or 2
      [Expanded_Rollover] = Expanded_Options
  
      'Call Private Sub located on Dashboard Sheet
      Call ExpandedDetailsShowHide
  
  End Function
  
  
  Private Sub ExpandedDetailsShowHide()
  Dim Expanded_Rollover As Integer
  
  If [Expanded_Rollover] = 1 Then
  
  ActiveSheet.Columns("O:S").Select
      If Selection.EntireColumn.Hidden Then
      ActiveSheet.Columns("O:S").Select
      Selection.EntireColumn.Hidden = True
      ActiveSheet.Range("E4").Select
      Else:
  
      If [Expanded_Rollover] = 2 Then
      ActiveSheet.Columns("O:S").Select
  
          If Selection.EntireColumn.Hidden Then
          ActiveSheet.Columns("O:S").Select
          Selection.EntireColumn.Hidden = False
          ActiveSheet.Range("E4").Select
          End If
  
  
      End If
  
  
  End Sub
  </code></pre>