Nick72310
04-14-2016, 02:22 PM
I need help with defining my ranges. When I use the code shown below, it will not follow my if statement based on the selected cell.
'Status Bar Display
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Intersect(Target, Range(Cells(4, 2), Cells(Rows.Count, 3))) Then
sr = Selection.Row
sc = Selection.Column
inquiry = Cells(sr, sc)
Select Case Sheets("Hide2").Cells(sr, sc)
Case False
Application.StatusBar = inquiry & " : does not exist."
Case ""
Application.StatusBar = ""
Case Else
MyDesc1 = Sheets("Hide2").Cells(sr, sc)
Application.StatusBar = inquiry & " : " & MyDesc1
End Select
ElseIf Intersect(Target, Range(Cells(3, 4), Cells(Rows.Count, Columns.Count))) Then
Application.StatusBar = "Testing"
End If
End Sub
'Status Bar Display
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Intersect(Target, Range(Cells(4, 2), Cells(Rows.Count, 3))) Then
sr = Selection.Row
sc = Selection.Column
inquiry = Cells(sr, sc)
Select Case Sheets("Hide2").Cells(sr, sc)
Case False
Application.StatusBar = inquiry & " : does not exist."
Case ""
Application.StatusBar = ""
Case Else
MyDesc1 = Sheets("Hide2").Cells(sr, sc)
Application.StatusBar = inquiry & " : " & MyDesc1
End Select
ElseIf Intersect(Target, Range(Cells(3, 4), Cells(Rows.Count, Columns.Count))) Then
Application.StatusBar = "Testing"
End If
End Sub