my macro is showing "run time error 1004", how do I fix it? my code is below. I highlighted the error in red.
If Range("V1") = "3" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Columns("e:h").Select
Selection.EntireColumn.Hidden = True
Columns("n:q").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
ElseIf Range("V1") = "4" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Columns("f:h").Select
Selection.EntireColumn.Hidden = True
Columns("o:q").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
ElseIf Range("V1") = "5" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Columns("g:h").Select
Selection.EntireColumn.Hidden = True
Columns("p:q").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
ElseIf Range("V1") = "6" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Columns("H").Select
Selection.EntireColumn.Hidden = True
Columns("Q").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
ElseIf Range("V1") = "7" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Range("A1").Select
Else
End If
End Sub
If Range("V1") = "3" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Columns("e:h").Select
Selection.EntireColumn.Hidden = True
Columns("n:q").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
ElseIf Range("V1") = "4" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Columns("f:h").Select
Selection.EntireColumn.Hidden = True
Columns("o:q").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
ElseIf Range("V1") = "5" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Columns("g:h").Select
Selection.EntireColumn.Hidden = True
Columns("p:q").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
ElseIf Range("V1") = "6" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Columns("H").Select
Selection.EntireColumn.Hidden = True
Columns("Q").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
ElseIf Range("V1") = "7" Then
Columns("a:r").Select
Selection.EntireColumn.Hidden = False
Range("A1").Select
Else
End If
End Sub