Simple Code Won't Work in Larger Code

mjseim

Board Regular
Joined
Apr 5, 2005
Messages
88
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>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
AHHH!!!! FORGET IT!! So sorry everyone... if someone knows how to delete this thread please feel free to do so. I was in the WRONG SHEET!!!


simple mistakes...
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top