I am running the following macro to export information to other worksheets. If I hide rows in the entry worksheet, the macro will not work. Is the Selection.EntireRow.Hidden=False causing it to crash? If so, can someone suggest a work around? If not, can someone suggest why it is crashing? Thanks in advance for your help.
VBA Code:
Sub Export_06()
'
' Export_06 Macro
'
'
Sheets("L-Transfer").Select
Range("A3:B3").Select
Sheets("Review").Select
Rows("3:1177").Select
Selection.EntireRow.Hidden = False
Range("A3").Select
Sheets("L-Transfer").Select
Range("A3:N479").Select
Selection.Copy
Sheets("Review").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A9:N479").Select
Application.CutCopyMode = False
ActiveSheet.PageSetup.PrintArea = "$A$9:$N$479"
Range("A3:N479").Select
ActiveSheet.PageSetup.PrintArea = "$A$3:$N$479"
Range("A9:N479").Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$9:$N$479"), , xlYes).Name = _
"Table7"
Range("Table7[#All]").Select
ActiveSheet.ListObjects("Table7").TableStyle = "TableStyleLight1"
ActiveSheet.ListObjects("Table7").TableStyle = ""
Rows("9:9").Select
Selection.RowHeight = 26.25
Range("Table7[#Headers]").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveWindow.SmallScroll Down:=-15
Range("A11").Select
ActiveSheet.ListObjects("Table7").Range.AutoFilter Field:=1, Criteria1:= _
"<>"
ActiveWorkbook.Worksheets("Review").ListObjects("Table7").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Review").ListObjects("Table7").Sort.SortFields.Add _
Key:=Range("Table7[[#All],[TASK '#]]"), SortOn:=xlSortOnValues, Order:= _
xlAscending, DataOption:=xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Review").ListObjects("Table7").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWindow.DisplayGridlines = False
ActiveWindow.SmallScroll Down:=3
Columns("A:A").Select
Range("A5").Activate
With Selection
.HorizontalAlignment = xlLeft
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("B10").Select
ActiveWindow.SmallScroll Down:=-21
Range("A5").Select
ActiveCell.FormulaR1C1 = "UNIT: "
Range("A6").Select
ActiveCell.FormulaR1C1 = "SYSTEM: "
Range("A7").Select
ActiveCell.FormulaR1C1 = "SUB SYS: "
Range("G4").Select
ActiveCell.FormulaR1C1 = "BLOCK: "
Range("G5").Select
ActiveCell.FormulaR1C1 = "EQUIP CLASS: "
Range("G7").Select
ActiveCell.FormulaR1C1 = "PLANNER: "
Range("P7").Select
Range("A5").Select
ActiveCell.FormulaR1C1 = "UNIT: "
Range("A6").Select
ActiveCell.FormulaR1C1 = "SYSTEM: "
Range("A7").Select
ActiveCell.FormulaR1C1 = "SUB SYS: "
Range("G4").Select
ActiveCell.FormulaR1C1 = "BLOCK: "
Range("G5").Select
ActiveCell.FormulaR1C1 = "EQUIP CLASS: "
Range("G7").Select
ActiveCell.FormulaR1C1 = "PLANNER: "
Range("P7").Select
End Sub