Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi, I have a spreadsheet I created for an administrator that has many extra rows with pre-set formulas. When we print though, there are a lot of empty rows in between the relevant data. I am trying to build a macro that will hide any row where column A is empty, then print, and then unhide them again. Below is the macro I have so far. But it does nothing! Any help or suggestions are appreciated as I haven't written macros in years. (I have latest version of Excel on Windows Vista.)
Sub PrintOrmondBeach() ' ' PrintOrmondBeach Macro Sheets("Ormond").Select Dim x As Integer ' Set numrows = number of rows of data. NumRows = Range("A1", Range("A1").End(xlDown)).Rows.Count Range("A1").Select For x = 1 To 300 If Ax = " " Then Selection.EntireRow.Hidden = True ' Selects cell down 1 row from active cell. End If ActiveCell.Offset(1, 0).Select Next ActiveWindow.SelectedSheets.PrintOut Copies:=1 Sheets("Print").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hide empty rows on open | Excel Discussion (Misc queries) | |||
Is there a way to automatically hide empty rows? | Excel Worksheet Functions | |||
Hide Empty Rows When Printing | Excel Worksheet Functions | |||
Format to hide empty rows | Excel Discussion (Misc queries) | |||
Macro to hide rows with empty cells | Excel Worksheet Functions |