Microsoft Office Tutorials and References
In Depth Information
& "!Print_Area" Then
ActiveSheet.Names(intCounter).Delete
intCounter = ActiveSheet.Names.count
ElseIf ActiveSheet.Names(intCounter).Name = ActiveSheet.Name _
& "!Print_Titles" Then
ActiveSheet.Names(intCounter).Delete
intCounter = ActiveSheet.Names.count
End If
intCounter = intCounter - 1
Wend
'Set print area
ActiveWorkbook.Names.Add Name:=ActiveSheet.Name & _
"!Print_Area", RefersTo:=strRange
'Set titles if needed
If vbYes Then
ActiveSheet.PageSetup.PrintTitleColumns = _
ActiveSheet.Columns("B:C").Address
ActiveSheet.PageSetup.PrintTitleRows = _
ActiveSheet.Rows("5:5").Address
End If
'Print worksheet
ActiveWorkbook.PrintPreview
End Sub
Search JabSto ::




Custom Search