Selection.EntireRow.Hidden=False

TMac52

New Member
Joined
Jan 30, 2012
Messages
17
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
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,215,633
Messages
6,125,922
Members
449,274
Latest member
mrcsbenson

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