Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email code Question to Ron de Bruin Please

See also your other thread Steve

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Steved" wrote in message ...
Hello Dave from Steved

Thankyou very much it's perfect.

"Dave Peterson" wrote:

Try adding a couple of lines he

ThisWorkbook.Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook

so it looks like:

ThisWorkbook.Sheets(Shname(N)).Copy
with activesheet.usedrange
.copy
.pastespecial paste:=xlpastevalues
end with
Set wb = ActiveWorkbook

Steved wrote:

Hello Ron from Steved

Ron what is required please to change the sheet to Value Only. Thankyou.

Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("Summary Report")
Addr = ")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Consolidated Report"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub


--

Dave Peterson

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
Email question for Ron de Bruin? Steph Excel Programming 3 June 5th 06 10:13 PM
question for Ron de Bruin JT[_2_] Excel Programming 3 September 17th 04 02:37 AM
Email Question (Ron De Bruin related) Lobo[_2_] Excel Programming 5 March 1st 04 02:01 PM
Email from Excel att: Ron de Bruin Edgar[_3_] Excel Programming 1 January 26th 04 04:03 PM
A Question for Ron de Bruin Jamal[_2_] Excel Programming 3 January 9th 04 04:12 PM


All times are GMT +1. The time now is 12:11 PM.

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"