Reset the print area to the whole sheet, Debbie.
Reset the print area to the whole sheet, Debbie.
Entia non sunt multiplicanda sine necessitate
Thanks for replying shg!
I don't know what happened but the code above now wants to include Columns A - C in the print preview, rather than B - C.
Also, it wants to print rows 4, 5, 7, and 10 no matter what active cells are in the column to be printed. *sigh*
Would it have to do with resetting the print for the whole sheet?
Rewind a bit and explain what you want.
You're right, it does sound a bit confusing. Lemme try again.
I created six PRINT buttons, one for each column -- H, I, J, K, L, and M. I want the user to be able to click the button over one of those columns to print that particular column WITH columns B and C. I also want to only print the non-blank cells within that column.
So I'm trying to create a code that will autofilter a column to include only non-blank cells, and then print columns B, C, and that chosen column, down to the last active cell.
Make sense? Attached is another sample. I appreciate your help with this. I'm trying to make our production manager's job a little easier. :-)
Debbie, try this:
![]()
Option Explicit Sub PrintRouting() PrintCol "H3", Array("A", "D:EV") End Sub Sub Print_Metal() PrintCol "I3", Array("A", "D:EV") End Sub Sub Print_Trim() PrintCol "J3", Array("A", "D:EV") End Sub Sub Print_Vinyl() PrintCol "K3", Array("A", "D:EV") End Sub Sub Print_Print() PrintCol "L3", Array("A", "D:EV") End Sub Sub Print_Paint() PrintCol "M3", Array("A", "D:EV") End Sub Sub PrintCol(sRng As String, avHide As Variant) Dim i As Long Dim v As Variant With ActiveSheet .AutoFilterMode = False .Rows("1:2").Hidden = True .PageSetup.PrintArea = .UsedRange.Address For Each v In avHide .Columns(v).Hidden = True Next v With .Range(sRng).EntireColumn .Hidden = False .Range(sRng).AutoFilter Field:=.Column, Criteria1:="<>" End With .PrintPreview .AutoFilterMode = False .Columns.Hidden = False .Rows.Hidden = False End With End Sub
Last edited by shg; 07-11-2009 at 05:20 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks