Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default 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
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... Maria J-son[_2_] Excel Programming 2 March 5th 06 12:20 PM


All times are GMT +1. The time now is 01:40 PM.

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"