Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Shname = Array("Sick Graph","Accident Graph")
Hello From Steved
Shname = Array("Sick Graph") To This please Shname = Array("Sick Graph","Accident Graph") Is it possible please ( Sending 2 worksheets from 1 workbook ) Thankyou. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Shname = Array("Sick Graph","Accident Graph")
I assume by "sending" you mean e-mailing. Check out Ron's site.
http://www.rondebruin.nl/sendmail.htm "Steved" wrote: Hello From Steved Shname = Array("Sick Graph") To This please Shname = Array("Sick Graph","Accident Graph") Is it possible please ( Sending 2 worksheets from 1 workbook ) Thankyou. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Shname = Array("Sick Graph","Accident Graph")
' STANDARD MODULE Option Explicit Sub Main() Dim shNames As Variant Dim shName As Variant Dim wb As Workbook Dim ws As Worksheet shNames = Array("Sick Graph", "Accident Graph") Set wb = Workbooks.Add() For Each shName In shNames Set ws = ThisWorkbook.Worksheets(shName) ws.Copy befo=wb.Worksheets(1) Next wb.SendMail "adresss1" End Sub "Steved" wrote: Hello From Steved Shname = Array("Sick Graph") To This please Shname = Array("Sick Graph","Accident Graph") Is it possible please ( Sending 2 worksheets from 1 workbook ) Thankyou. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Shname = Array("Sick Graph","Accident Graph")
I haven't tried the code but I would have thought you'd end up with
(typically) three additional empty sheets. Of course those could be deleted but could do this - Sheets(Array("Sick Graph", "Accident Graph")).Copy with ActiveWorkbook ..Saveas "NameForTheEmail.xls" s = .Fullname ..SendMail "adresss1" ..Close false End With Kill s I think it'd better though to follow Ron de Bruin's example in the link provided by JLGWhiz To the OP - If those sheets are chart-sheets, or if one or both are worksheet(s) but do not include all chart source data, you'll need to remove any links to data in the original workbook before mailing. Regards, Peter T "Patrick Molloy" wrote in message ... ' STANDARD MODULE Option Explicit Sub Main() Dim shNames As Variant Dim shName As Variant Dim wb As Workbook Dim ws As Worksheet shNames = Array("Sick Graph", "Accident Graph") Set wb = Workbooks.Add() For Each shName In shNames Set ws = ThisWorkbook.Worksheets(shName) ws.Copy befo=wb.Worksheets(1) Next wb.SendMail "adresss1" End Sub "Steved" wrote: Hello From Steved Shname = Array("Sick Graph") To This please Shname = Array("Sick Graph","Accident Graph") Is it possible please ( Sending 2 worksheets from 1 workbook ) Thankyou. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Shname = Array("Sick Graph","Accident Graph")
Hello from Steved
I thankyou all for your reponses. "Peter T" wrote: I haven't tried the code but I would have thought you'd end up with (typically) three additional empty sheets. Of course those could be deleted but could do this - Sheets(Array("Sick Graph", "Accident Graph")).Copy with ActiveWorkbook ..Saveas "NameForTheEmail.xls" s = .Fullname ..SendMail "adresss1" ..Close false End With Kill s I think it'd better though to follow Ron de Bruin's example in the link provided by JLGWhiz To the OP - If those sheets are chart-sheets, or if one or both are worksheet(s) but do not include all chart source data, you'll need to remove any links to data in the original workbook before mailing. Regards, Peter T "Patrick Molloy" wrote in message ... ' STANDARD MODULE Option Explicit Sub Main() Dim shNames As Variant Dim shName As Variant Dim wb As Workbook Dim ws As Worksheet shNames = Array("Sick Graph", "Accident Graph") Set wb = Workbooks.Add() For Each shName In shNames Set ws = ThisWorkbook.Worksheets(shName) ws.Copy befo=wb.Worksheets(1) Next wb.SendMail "adresss1" End Sub "Steved" wrote: Hello From Steved Shname = Array("Sick Graph") To This please Shname = Array("Sick Graph","Accident Graph") Is it possible please ( Sending 2 worksheets from 1 workbook ) Thankyou. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... | Excel Programming |