Hi All
I a noob with this VBA I am trying to do somthing the same as Excel Freelance, on you tube and i have hit a bit of a snag
On the proceure page i am trying to have each tab open a diffrent page and its not working. I have followed the same as what he has been doing
Sub SwitchHorizontalTabs()
Dim SelCol As Long
Dim FirstRow As Long
With Sheet1
SelCol = .Range("B2").Value
.Range("5:84").EntireRow.Hidden = True
FirstRow = 5 + ((SelCol - 5) * 20)
.Range(FirstRow & ":" & FirstRow + 19).EntireRow.Hidden = False
End With
End Sub
Sub SwitchVerticalTabs()
Dim SelRow As Long
Dim FirstRow As Long
SelRow = Right(AvtiveCel.Row, 1) - 5
With Sheet1
.Range("46:144").EntireRow.Hidden = True
FirstRow = 46 + ((SelRow - 1) * 20)
.Range(FirstRow & ":" & FirstRow + 19).EntireRow.Hidden = False
.Range("B3").Value = SelRow + FirstRow
.Range("F2").Select
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("E4:H4")) Is Nothing Then
If Target.Count > 1 Then Exit Sub
Range("B2").Value = Target.Column
Range("F2").Select
SwitchHorizontalTabs
End If
If Not Intersect(Target, Range("E46:E144")) Is Nothing Then
If Target.Value = Empty Or Target.Value = "Select Options" Then Exit Sub
SwitchVerticalTabs
End With
End Sub
The top line on the second code is highlighted yellow as well and i can't get it to work
Bookmarks