Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code Not Working tictox Excel Discussion (Misc queries) 3 October 25th 10 04:25 PM
VBA Code Not Working tictox Excel Discussion (Misc queries) 0 July 6th 10 06:40 PM
VB Code Is Not Working Rob Excel Discussion (Misc queries) 2 May 30th 07 05:23 PM
Code not working and can't see why Steve Excel Discussion (Misc queries) 3 December 31st 04 03:12 PM
For Each Code Not Working jacqui[_2_] Excel Programming 4 July 29th 03 02:44 AM


All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"