I have two fold question ...one I want to add to this Module (I am a total newbie at doing this) but basically I wanted to have a macro that does all three of these in one shot (macro).... as of right now they are three separate macros to do the work.
Explanation of Macro - basically each macro finds a specific row and column to look for the first blank cell and than hides all blank cells....It does this for three different places in my work sheet (3 different graphs that have dynamic data)
I also wanted to add two more "macro's" so to speak that does the same thing except it doesn't hide the first blank row...so basically hides the second blank row found and onwards. Please let me know if:
1) I can combine these Macro's into ONE Macro
2) How I can re-arrange the code so that it wont hide the first blank row, but will hide the second and than after:
Sub HURows()
BeginRow = 12
EndRow = 152
ChkCol = 37
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Sub Chart2()
BeginRow = 165
EndRow = 298
ChkCol = 44
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Sub Chart3()
BeginRow = 312
EndRow = 464
ChkCol = 88
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Explanation of Macro - basically each macro finds a specific row and column to look for the first blank cell and than hides all blank cells....It does this for three different places in my work sheet (3 different graphs that have dynamic data)
I also wanted to add two more "macro's" so to speak that does the same thing except it doesn't hide the first blank row...so basically hides the second blank row found and onwards. Please let me know if:
1) I can combine these Macro's into ONE Macro
2) How I can re-arrange the code so that it wont hide the first blank row, but will hide the second and than after:
Sub HURows()
BeginRow = 12
EndRow = 152
ChkCol = 37
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Sub Chart2()
BeginRow = 165
EndRow = 298
ChkCol = 44
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Sub Chart3()
BeginRow = 312
EndRow = 464
ChkCol = 88
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub