A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Emailing print area



 
 
Thread Tools Display Modes
  #1  
Old April 1st, 2005, 03:39 PM
TexMas
external usenet poster
 
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  
Old April 1st, 2005, 04:03 PM
Ron de Bruin
external usenet poster
 
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!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I print only "active" tasks in the taskpad area of the day. RaleighTom Calendar 2 November 25th, 2004 04:24 AM
Trouble adding non-adjacent cell columns to a print area JoAnn New Users 6 July 30th, 2004 12:32 AM
How to print a word document with style names printed on the left margin (style area width) Ginger General Discussion 1 June 8th, 2004 10:05 AM
Variable Print Area Terry Bennett Worksheet Functions 1 November 20th, 2003 08:08 PM


All times are GMT +1. The time now is 09:59 PM.


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