Dark0Prince
Active Member
- Joined
- Feb 17, 2016
- Messages
- 433
I want to be able to hide sections of my spreadsheet. From let's say the GJ section to the end of the GJ section. But I don't know how to define the end of the GJ section because new data keeps moving the rows down and changing how big the section is. This code below works but as soon as I insert another row this will not grab the whole section anymore because it is now bigger. Is there a way I can define the end of the section. I'm using command buttons for this code
Sub GJ()
'
' GJ Macro
' UNSHRINKS ALL SECTIONS>HIDES ALL SECTIONS THAT YOU DON'T WANT TO SEE
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Rows("2:2").Select
ActiveWindow.SmallScroll Down:=519
Rows("2:539").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=309
Rows("861:861").Select
ActiveWindow.SmallScroll Down:=1143
Rows("861:2000").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-465
Range("A1").Select
End Sub
Sub GJ()
'
' GJ Macro
' UNSHRINKS ALL SECTIONS>HIDES ALL SECTIONS THAT YOU DON'T WANT TO SEE
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Rows("2:2").Select
ActiveWindow.SmallScroll Down:=519
Rows("2:539").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=309
Rows("861:861").Select
ActiveWindow.SmallScroll Down:=1143
Rows("861:2000").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-465
Range("A1").Select
End Sub