Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Do not email sheet if nothing on it.

Hello from Steved

Ok I have Ron's email program which emails to seperate accounts.

My question is if on Cell B6 the cell has no values in it, is their away I
can instruct the program not to send that particular worksheet.

I have 10 worksheets sometimes only 8 off them need to be emailed.

Thankyou.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Do not email sheet if nothing on it.

Which sub Steve ?
Can you post the link

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


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

Ok I have Ron's email program which emails to seperate accounts.

My question is if on Cell B6 the cell has no values in it, is their away I
can instruct the program not to send that particular worksheet.

I have 10 worksheets sometimes only 8 off them need to be emailed.

Thankyou.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Do not email sheet if nothing on it.

Hello Ron From Steved

Ron the file I emailed you last week.

Would you be so kind and have a look at it again.

Ok this is what I am asking and that is, take City (1) as an example
I have no values in cell B6 is it possible not to Email City (1) but email
the rest.

Thankyou.

"Ron de Bruin" wrote:

Which sub Steve ?
Can you post the link

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


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

Ok I have Ron's email program which emails to seperate accounts.

My question is if on Cell B6 the cell has no values in it, is their away I
can instruct the program not to send that particular worksheet.

I have 10 worksheets sometimes only 8 off them need to be emailed.

Thankyou.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Do not email sheet if nothing on it.

Hi Steve

Please post a link from a example page from my site the next time that looks like it.
I don't remember all the code I see<g

I believe you used this example ?
http://www.rondebruin.nl/mail/folder1/mail2.htm
Example 2

Try this with this check
If Sheets(Shname(N)).Range("B6") < "" Then


Sub Mail_test()
Dim wb As Workbook
Dim strdate As String
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer

strdate = Format(Now, "dd-mm-yy h-mm-ss")
Shname = Array("Sheet1", "Sheet2", "Sheet3", "Sheet4")
Addr = ", ", ", ")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
If Sheets(Shname(N)).Range("B6") < "" Then
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Sheet " & Shname(N) _
& " " & strdate & ".xls"
.SendMail Addr(N), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
End If
Next N
Application.ScreenUpdating = True
End Sub


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


"Steved" wrote in message ...
Hello Ron From Steved

Ron the file I emailed you last week.

Would you be so kind and have a look at it again.

Ok this is what I am asking and that is, take City (1) as an example
I have no values in cell B6 is it possible not to Email City (1) but email
the rest.

Thankyou.

"Ron de Bruin" wrote:

Which sub Steve ?
Can you post the link

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


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

Ok I have Ron's email program which emails to seperate accounts.

My question is if on Cell B6 the cell has no values in it, is their away I
can instruct the program not to send that particular worksheet.

I have 10 worksheets sometimes only 8 off them need to be emailed.

Thankyou.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Do not email sheet if nothing on it.

Sorry Ron


Sub Mail_test()
Dim wb As Workbook
Dim strdate As String
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer

strdate = Format(Now, "dd-mm-yy hh-mm-ss")
Shname = Array("Summary", "City Depot (1)", "Roskill Depot (2)",
"Papakura Depot (3)", "Wiri Depot (4)", "Shore Depot (5)", "Orewa Depot (6)",
"Swanson Depot (7)", "Panmure Depot (8)", "Waiheke Depot (9)")
Addr = ", ",
", ",
", ",
", ",
", ")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
If Shname(N) = "Summary" Then
Sheets(Shname(N)).Copy
Else
Sheets(Array("Summary", Shname(N))).Copy
End If

Worksheets.Select
Cells.Copy
Cells.PasteSpecial xlPasteValues
Cells(1).Select
Worksheets(1).Select
Application.CutCopyMode = False

Set wb = ActiveWorkbook
If Shname(N) < "Summary" Then
Application.DisplayAlerts = False
wb.Sheets("Summary").Delete
Application.DisplayAlerts = True
End If

With wb
.SaveAs "C:/Audit Reports/" & Format(Now, "dd - mm - yy, hh - mm
- ss") & ".xls"
.SendMail Addr(N), "Audit Summary from Mr R.Stephens"
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub


"Ron de Bruin" wrote:

Hi Steve

Please post a link from a example page from my site the next time that looks like it.
I don't remember all the code I see<g

I believe you used this example ?
http://www.rondebruin.nl/mail/folder1/mail2.htm
Example 2

Try this with this check
If Sheets(Shname(N)).Range("B6") < "" Then


Sub Mail_test()
Dim wb As Workbook
Dim strdate As String
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer

strdate = Format(Now, "dd-mm-yy h-mm-ss")
Shname = Array("Sheet1", "Sheet2", "Sheet3", "Sheet4")
Addr = ", ", ", ")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
If Sheets(Shname(N)).Range("B6") < "" Then
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Sheet " & Shname(N) _
& " " & strdate & ".xls"
.SendMail Addr(N), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
End If
Next N
Application.ScreenUpdating = True
End Sub


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


"Steved" wrote in message ...
Hello Ron From Steved

Ron the file I emailed you last week.

Would you be so kind and have a look at it again.

Ok this is what I am asking and that is, take City (1) as an example
I have no values in cell B6 is it possible not to Email City (1) but email
the rest.

Thankyou.

"Ron de Bruin" wrote:

Which sub Steve ?
Can you post the link

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


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

Ok I have Ron's email program which emails to seperate accounts.

My question is if on Cell B6 the cell has no values in it, is their away I
can instruct the program not to send that particular worksheet.

I have 10 worksheets sometimes only 8 off them need to be emailed.

Thankyou.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Do not email sheet if nothing on it.

Hi Steve

Same answer

Add
If Sheets(Shname(N)).Range("B6") < "" Then
after For N = LBound(Shname) To UBound(Shname)

And one
End if
before Next N



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


"Steved" wrote in message ...
Sorry Ron


Sub Mail_test()
Dim wb As Workbook
Dim strdate As String
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer

strdate = Format(Now, "dd-mm-yy hh-mm-ss")
Shname = Array("Summary", "City Depot (1)", "Roskill Depot (2)",
"Papakura Depot (3)", "Wiri Depot (4)", "Shore Depot (5)", "Orewa Depot (6)",
"Swanson Depot (7)", "Panmure Depot (8)", "Waiheke Depot (9)")
Addr = ", ",
", ",
", ",
", ",
", ")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
If Shname(N) = "Summary" Then
Sheets(Shname(N)).Copy
Else
Sheets(Array("Summary", Shname(N))).Copy
End If

Worksheets.Select
Cells.Copy
Cells.PasteSpecial xlPasteValues
Cells(1).Select
Worksheets(1).Select
Application.CutCopyMode = False

Set wb = ActiveWorkbook
If Shname(N) < "Summary" Then
Application.DisplayAlerts = False
wb.Sheets("Summary").Delete
Application.DisplayAlerts = True
End If

With wb
.SaveAs "C:/Audit Reports/" & Format(Now, "dd - mm - yy, hh - mm
- ss") & ".xls"
.SendMail Addr(N), "Audit Summary from Mr R.Stephens"
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub


"Ron de Bruin" wrote:

Hi Steve

Please post a link from a example page from my site the next time that looks like it.
I don't remember all the code I see<g

I believe you used this example ?
http://www.rondebruin.nl/mail/folder1/mail2.htm
Example 2

Try this with this check
If Sheets(Shname(N)).Range("B6") < "" Then


Sub Mail_test()
Dim wb As Workbook
Dim strdate As String
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer

strdate = Format(Now, "dd-mm-yy h-mm-ss")
Shname = Array("Sheet1", "Sheet2", "Sheet3", "Sheet4")
Addr = ", ", ", ")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
If Sheets(Shname(N)).Range("B6") < "" Then
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Sheet " & Shname(N) _
& " " & strdate & ".xls"
.SendMail Addr(N), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
End If
Next N
Application.ScreenUpdating = True
End Sub


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


"Steved" wrote in message ...
Hello Ron From Steved

Ron the file I emailed you last week.

Would you be so kind and have a look at it again.

Ok this is what I am asking and that is, take City (1) as an example
I have no values in cell B6 is it possible not to Email City (1) but email
the rest.

Thankyou.

"Ron de Bruin" wrote:

Which sub Steve ?
Can you post the link

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


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

Ok I have Ron's email program which emails to seperate accounts.

My question is if on Cell B6 the cell has no values in it, is their away I
can instruct the program not to send that particular worksheet.

I have 10 worksheets sometimes only 8 off them need to be emailed.

Thankyou.








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
send email to each customer email in excel sheet. -keevill- Excel Discussion (Misc queries) 3 July 17th 08 02:33 PM
email a sheet Uti Setting up and Configuration of Excel 0 September 16th 05 09:29 AM
eMail a sheet ijb Excel Programming 0 June 8th 04 09:02 PM
eMail a sheet Bob Phillips[_6_] Excel Programming 0 June 8th 04 08:58 PM
eMail a sheet Ron de Bruin Excel Programming 0 June 8th 04 08:40 PM


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