Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Shname = Array("Sick Graph","Accident Graph")

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steved - 12 Mar 2008 01:37 GMT
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.
JLGWhiz - 12 Mar 2008 03:22 GMT
I assume by "sending" you mean e-mailing.  Check out Ron's site.

http://www.rondebruin.nl/sendmail.htm

> Hello From Steved
>
[quoted text clipped - 6 lines]
> Is it possible please ( Sending 2 worksheets from 1 workbook )
> Thankyou.
Patrick Molloy - 12 Mar 2008 14:39 GMT
' 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 before:=wb.Worksheets(1)
   
   Next
   
   wb.SendMail "adresss1"

End Sub

> Hello From Steved
>
[quoted text clipped - 6 lines]
> Is it possible please ( Sending 2 worksheets from 1 workbook )
> Thankyou.
Peter T - 12 Mar 2008 15:56 GMT
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

> ' STANDARD MODULE
> Option Explicit
[quoted text clipped - 27 lines]
> > Is it possible please ( Sending 2 worksheets from 1 workbook )
> > Thankyou.
Steved - 12 Mar 2008 19:04 GMT
Hello from Steved

I thankyou all for your reponses.

> 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
[quoted text clipped - 50 lines]
> > > Is it possible please ( Sending 2 worksheets from 1 workbook )
> > > Thankyou.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.