I'm getting really frustrated with the following code. The entire thing works perfectly except for the 3rd to last line (entirerow.hidden = true). To me, this is a really straight forward line and when I run it as it's own macro it works just fine. However, when kept in the larger macro, where I want it, it doesn't work! I don't get an error or anything... it just doesn't work. When I call another macro (thinking that if it worked in another macro then couldn't I just reference it) that also didn't work.
When I moved screenupdating before the line it also didn't work.
Please, any help would be greatly appreciated.
<code>
Sub budgetConsolidateData()
' Macro created 1/30/2009 by Mike Seim
'--------------------------------------------------------------------------------------------------------------
'Ready the macro
Application.ScreenUpdating = False
'--------------------------------------------------------------------------------------------------------------
'Clear the consolidation range
Sheets("Data (Consolidated)").Select
Range("J9:Q5000").ClearContents
'--------------------------------------------------------------------------------------------------------------
'Copy data from Mid-Atlantic
Sheets("Data (MA)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Copy data from Southeast
Sheets("Data (SE)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Copy data from Central
Sheets("Data (Ctl)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Copy data from TX
Sheets("Data (TX)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Copy data from West
Sheets("Data (West)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Cleanup
Sheets("Data (Consolidated)").Select
Cells.EntireColumn.AutoFit
Rows("89:93").EntireRow.Hidden = True '<--- THIS WON'T WORK
Range("A1").Select
Application.ScreenUpdating = True
End Sub
</code>
When I moved screenupdating before the line it also didn't work.
Please, any help would be greatly appreciated.
<code>
Sub budgetConsolidateData()
' Macro created 1/30/2009 by Mike Seim
'--------------------------------------------------------------------------------------------------------------
'Ready the macro
Application.ScreenUpdating = False
'--------------------------------------------------------------------------------------------------------------
'Clear the consolidation range
Sheets("Data (Consolidated)").Select
Range("J9:Q5000").ClearContents
'--------------------------------------------------------------------------------------------------------------
'Copy data from Mid-Atlantic
Sheets("Data (MA)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Copy data from Southeast
Sheets("Data (SE)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Copy data from Central
Sheets("Data (Ctl)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Copy data from TX
Sheets("Data (TX)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Copy data from West
Sheets("Data (West)").Select
Range("A8:H1000").Copy
Sheets("Data (Consolidated)").Select
Range("J9").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'--------------------------------------------------------------------------------------------------------------
'Cleanup
Sheets("Data (Consolidated)").Select
Cells.EntireColumn.AutoFit
Rows("89:93").EntireRow.Hidden = True '<--- THIS WON'T WORK
Range("A1").Select
Application.ScreenUpdating = True
End Sub
</code>