Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
why this code not working
Sulu,
You need to pass a string value to .PrintArea .PrintArea = rng1.Address or, if you already have a Rng2 named range: .PrintArea = Range("rng2").Address HTH, Bernie Excel MVP "sulu" wrote in message ... hi all, i just want to select first 6 column s of my filtered data range what is wrong with my code? Set rng = ActiveSheet.AutoFilter.Range On Error Resume Next With rng Set rng1 = .Offset(1, 0).Resize(.Rows.Count - 1, 6) _ .SpecialCells(xlCellTypeVisible) End With With ActiveSheet.PageSetup .PrintArea = Range ("rng2") .CenterFooter = "Page &P of &N" .RightFooter = "Printed on &D" .PrintHeadings = False .CenterHorizontally = True .Orientation = xlPortrait .PrintTitleRows = "$2:$2" .FitToPagesWide = 1 End With Sulu |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Code Not Working | Excel Discussion (Misc queries) | |||
VBA Code Not Working | Excel Discussion (Misc queries) | |||
VB Code Is Not Working | Excel Discussion (Misc queries) | |||
Code not working and can't see why | Excel Discussion (Misc queries) | |||
For Each Code Not Working | Excel Programming |