LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Printing Setup help

Garry & All

As promised here is the final working very well code:

Sub PrintHDC()

Dim theDay As String
Dim theDate As String
Dim myDate As String

theDay = Format(Date, "Ddd")

If theDay = "Mon" Then
theDate = Date - 3
Else
theDate = Date - 1
End If

myDate = Format(theDate, "Ddd, dd-Mmm-yy")

Columns("L:L").Select
Selection.ColumnWidth = 30

Cells.Select
With Selection
.WrapText = True
End With
Rows("2:200").Select
Selection.Rows.AutoFit

Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Selection.Sort Key1:=Range("D2"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

With ActiveSheet.PageSetup
.PrintArea = Selection.Address
.PrintTitleRows = "$1:$1"
.CenterHeader = "HDC - " & myDate
.FitToPagesWide = 1
End With

Application.ActivePrinter = "\\SPRN01\WOW HDC on Ne01:"
ActiveWindow.SelectedSheets.PrintPreview

End Sub

Cheers




 
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
printing setup issue in 2007 Zhi Sheng Excel Discussion (Misc queries) 1 November 8th 09 11:00 PM
Printing - Setup Natarajan Setting up and Configuration of Excel 2 October 25th 07 11:49 AM
Page Setup Printing Sharon Excel Discussion (Misc queries) 0 December 6th 06 02:55 PM
can VBA be used to set page setup for printing? Dave F Excel Discussion (Misc queries) 2 November 21st 06 06:27 PM
setup for userform printing Jacob Excel Programming 6 September 23rd 06 01:00 AM


All times are GMT +1. The time now is 09:54 AM.

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

About Us

"It's about Microsoft Excel"