All2Cheesy
Board Regular
- Joined
- Mar 4, 2015
- Messages
- 127
Hi all,
I've got a macro which shows all fields in a pivot table, and then takes the data and places it alphabetically in another sheet via a formula in the cells of the second sheet. What I would like to do is hide the blank cells (empty text " "). or at the very least move them to the bottom of the column
Currently when I try to hide the blank cells, all cells in the range get hidden, unless I run the formula twice in which case it works. Help would be appreciated.
I've got a macro which shows all fields in a pivot table, and then takes the data and places it alphabetically in another sheet via a formula in the cells of the second sheet. What I would like to do is hide the blank cells (empty text " "). or at the very least move them to the bottom of the column
Currently when I try to hide the blank cells, all cells in the range get hidden, unless I run the formula twice in which case it works. Help would be appreciated.

Code:
Sub ShowAllPivot()
'Disable additional features
With Application
.ScreenUpdating = False
.Calculation = Manual
.EnableEvents = False
.DisplayAlerts = False
End With
Dim oneCell As Range
'Show All
ActiveSheet.PivotTables("PivotTable1").PivotFields("Zone to").ShowDetail = True
'Swap sheets
ThisWorkbook.Sheets("Summary (Bulk)").Activate
'Sort data
Range("B481:B633").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=6
ActiveWindow.ScrollRow = 1
Selection.Sort Key1:=Range("B481"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'Hide blanks
Range("B481:B633").EntireRow.Hidden = False
For Each oneCell In Range("B481:A633").SpecialCells(xlCellTypeFormulas, xlTextValues)
oneCell.EntireRow.Hidden = (oneCell.Value = vbNullString)
Next oneCell
'Enable additional feautres
With Application
.ScreenUpdating = True
.Calculation = xlAutomatic
.EnableEvents = True
.DisplayAlerts = True
End With
'Go to lanes
ActiveWindow.LargeScroll Down:=1
Range("A1").Select
End Sub