#1   Report Post  
TexMas
 
Posts: n/a
Default Emailing print area

Any ideas how I can email only the print area of a worksheet? I also need to
be able to save only the print area into another file. Both of these have to
be done with absolutely no technical expertise, in other words just push a
button, no copy and paste or anything else so technical!
  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi Texmas

Try this one for the activesheet
It will save the file in C:\
Change the e-mail address

More info on my site
http://www.rondebruin.nl/sendmail.htm

See David McRitchie's site if you just started with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm


Sub Mail_Range()
Dim source As Range
Dim dest As Workbook
Dim strdate As String

Set source = Nothing
On Error Resume Next
Set source = Range(ActiveSheet.PageSetup.PrintArea).SpecialCell s(xlCellTypeVisible)
On Error GoTo 0
If source Is Nothing Then
MsgBox "The source is not a range or the sheet is protect, please correct and try again.", vbOKOnly
Exit Sub
End If

Application.ScreenUpdating = False
Set dest = Workbooks.Add(xlWBATWorksheet)
source.Copy
With dest.Sheets(1)
.Cells(1).PasteSpecial Paste:=8
' Paste:=8 will copy the column width in Excel 2000 and higher
' If you use Excel 97 use the other example
.Cells(1).PasteSpecial xlPasteValues, , False, False
.Cells(1).PasteSpecial xlPasteFormats, , False, False
.Cells(1).Select
Application.CutCopyMode = False
End With

strdate = Format(Now, "dd-mm-yy h-mm-ss")
With dest
.SaveAs "C:\Selection of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail ", _
"This is the Subject line"
.Close False
End With
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"TexMas" wrote in message ...
Any ideas how I can email only the print area of a worksheet? I also need to
be able to save only the print area into another file. Both of these have to
be done with absolutely no technical expertise, in other words just push a
button, no copy and paste or anything else so technical!



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
set the print area print multiple tabs veng Excel Discussion (Misc queries) 5 February 12th 05 07:01 PM
How to Dynamically Set Print Area Jerry B Excel Discussion (Misc queries) 2 February 1st 05 11:21 PM
Printing - Have to set print area 1 column further than necessary STUART BISSET Excel Discussion (Misc queries) 0 January 24th 05 07:59 PM
Changing print area Aaron Excel Discussion (Misc queries) 2 January 9th 05 05:58 PM
print a specific area within a worksheet by clicking on print? honclub Excel Worksheet Functions 1 October 29th 04 03:22 AM


All times are GMT +1. The time now is 07:35 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"