I am trying hide column A and B as well as even number rows 4-88. When I do this for some reason rows 10-30 get completely hidden in addition the other rows I am hiding. I have tried doing the macro over several times with no success. The odd numbered rows 11-29 are not listed in the macro VB code.
Columns("A:B").Select
Selection.EntireColumn.Hidden = True
Rows("4:4").Select
Range("C4").Activate
ActiveWindow.SmallScroll Down:=3
Range("4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22").Select
Range("C22").Activate
ActiveWindow.SmallScroll Down:=18
Range( _
"4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40" _
).Select
Range("C40").Activate
ActiveWindow.SmallScroll Down:=18
Range( _
"4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,52:52,54:54,56:56,58:58" _
).Select
Range("C58").Activate
ActiveWindow.SmallScroll Down:=18
Union(Range( _
"68:68,70:70,72:72,74:74,76:76,4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,52:52,54:54,56:56" _
), Range("58:58,60:60,62:62,64:64,66:66")).Select
Range("C76").Activate
ActiveWindow.SmallScroll Down:=12
Union(Range( _
"68:68,70:70,72:72,74:74,76:76,78:78,80:80,82:82,4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50" _
), Range("52:52,54:54,56:56,58:58,60:60,62:62,64:64,66:66")).Select
Range("C82").Activate
Selection.EntireRow.Hidden = True
Range("A1").Select
End Sub
I have tried modifying the code but get a syntax error. I don't know VB.
Any help would be appreciated.
Here is my modified code.
Columns("A:B").Select
Selection.EntireColumn.Hidden = True
Range( _
"4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,52:52,54:54,56:56,58:58,60:60,62:62,64:64,66:66,68:68,70:70,72:72,74:74,76:76,78:78,80:80,82:82,84:84,86:86,88:88"_
).Select
Range("C88").Activate
Selection.EntireRow.Hidden = True
End Sub
Columns("A:B").Select
Selection.EntireColumn.Hidden = True
Rows("4:4").Select
Range("C4").Activate
ActiveWindow.SmallScroll Down:=3
Range("4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22").Select
Range("C22").Activate
ActiveWindow.SmallScroll Down:=18
Range( _
"4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40" _
).Select
Range("C40").Activate
ActiveWindow.SmallScroll Down:=18
Range( _
"4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,52:52,54:54,56:56,58:58" _
).Select
Range("C58").Activate
ActiveWindow.SmallScroll Down:=18
Union(Range( _
"68:68,70:70,72:72,74:74,76:76,4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,52:52,54:54,56:56" _
), Range("58:58,60:60,62:62,64:64,66:66")).Select
Range("C76").Activate
ActiveWindow.SmallScroll Down:=12
Union(Range( _
"68:68,70:70,72:72,74:74,76:76,78:78,80:80,82:82,4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50" _
), Range("52:52,54:54,56:56,58:58,60:60,62:62,64:64,66:66")).Select
Range("C82").Activate
Selection.EntireRow.Hidden = True
Range("A1").Select
End Sub
I have tried modifying the code but get a syntax error. I don't know VB.
Any help would be appreciated.
Here is my modified code.
Columns("A:B").Select
Selection.EntireColumn.Hidden = True
Range( _
"4:4,6:6,8:8,10:10,12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,52:52,54:54,56:56,58:58,60:60,62:62,64:64,66:66,68:68,70:70,72:72,74:74,76:76,78:78,80:80,82:82,84:84,86:86,88:88"_
).Select
Range("C88").Activate
Selection.EntireRow.Hidden = True
End Sub