Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to delete columns and set print area

Does anyone have a macro that can delete a pre-set series of columns an
then set the page setup to print 1 page wide in Landscape format pleas
?

I.e. Delete columns b,c,d and f, then page setup to print 1 page wid
in landscape format.

I have a daily report which contains a number of columns which I don
need and I delete them normally before printing the report off to fi
to at least 1 page wide. The number of pages high is dependant on ho
long the report is

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Macro to delete columns and set print area

Sub test()
Range("B:B,C:C,D:D,F:F").Delete xlShiftToLeft
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"twaccess " wrote in message
...
Does anyone have a macro that can delete a pre-set series of columns and
then set the page setup to print 1 page wide in Landscape format please
?

I.e. Delete columns b,c,d and f, then page setup to print 1 page wide
in landscape format.

I have a daily report which contains a number of columns which I dont
need and I delete them normally before printing the report off to fit
to at least 1 page wide. The number of pages high is dependant on how
long the report is.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to delete columns and set print area

Thanks very much for this Rob. It is much appreciated and will make m
daily life easier.

There is another bit of finesse though. What would the coding be t
autofit the column widths to the text as well please ?

Thanks

T

--
Message posted from http://www.ExcelForum.com

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
delete unused columns and grey out the rest area random number generator Excel Worksheet Functions 1 March 31st 06 06:32 PM
Can you delete all hidden columns in an area in one move? Gizmofied Excel Discussion (Misc queries) 2 February 2nd 06 10:41 PM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
Identify and Delete all Rows and Columns NOT in Print Area Keith Young[_2_] Excel Programming 6 December 4th 03 04:36 PM


All times are GMT +1. The time now is 10:19 AM.

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"