Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Original post seems to have disappeared :(
Need to filter rows before printing, hiding rows that aren't in desired month or don't have desired date entries in range. Borrowing from another file I got half of what I want: Private Sub Workbook_BeforePrint(Cancel As Boolean) On Error GoTo Quit Range("D4:C" & Range("Print_Area").Rows.Count).SpecialCells _ (xlCellTypeBlanks).EntireRow.Hidden = True '<-- Need another line here for handling needed month Application.OnTime Now(), ThisWorkbook.Name & "!WorkbookAfterPrint" Quit: End Sub Sub WorkbookAfterPrint() Range("C4:C" & Range("Print_Area").Rows.Count).SpecialCells _ (xlCellTypeBlanks).EntireRow.Hidden = False '<-- Need another line here for handling needed month End Sub I do have a conditional formatting formula set and think it could be adapted to look at the desired range, but need help with VBA syntax: =AND(YEAR(D4)=YEAR($A$2),MONTH(D4)=MONTH($A$2)) IOW, how to adapt the formula to VBA -- David |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print Question? | Excel Discussion (Misc queries) | |||
Do not print one cell question? | Setting up and Configuration of Excel | |||
Another Print Area question | Excel Discussion (Misc queries) | |||
Print Question Newbie Please help | New Users to Excel | |||
Print question? | Excel Discussion (Misc queries) |