Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2005, 01:02 PM
Authorized User
 
Join Date: Oct 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Send Worksheet

Hello,

I have a huge spreadsheet, but what I want to do is to send one worksheet from it to an indvidual. So when the suer clicks send, it will automatically abstract the worksheet and the user will only receive this and nothing else.

How is this done

Thanks

Alan
 
Old November 2nd, 2005, 06:25 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Alan

Make a VBA-code that copies ActiveSheet to new workbook and after that you send the new workbook.

Sub CopySheet()

    ActiveSheet.Copy
    ActiveWorkbook.SendMail "[email protected]", "Subject"

End Sub

-vemaju


 
Old November 2nd, 2005, 08:08 AM
Authorized User
 
Join Date: Oct 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thats great, but I have a slight problem! That copies the worksheet that i want to send, but it creates a new workbook, which i don't want to happen. All I want is for the relevant worksheet to be extracted and for that to be emailed to the user is that possible.
 
Old November 2nd, 2005, 01:04 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Close the workbook without saving it.
Sub CopySheet()

    ActiveSheet.Copy
    ActiveWorkbook.SendMail "[email protected]", "Subject"
    ActiveWorkbook.Close SaveChanges:=False
End Sub

-vemaju






Similar Threads
Thread Thread Starter Forum Replies Last Post
Send URL request to send sms via NowSMS deco BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 0 February 16th, 2008 02:45 PM
Open up Worksheet alannoble26 Excel VBA 5 February 13th, 2006 02:24 PM
Run Time Error - Send Worksheet alannoble26 Excel VBA 0 November 8th, 2005 07:42 AM
Email Worksheet alannoble26 Excel VBA 2 November 7th, 2005 10:33 AM
how to name worksheet by Month yylee Excel VBA 2 April 10th, 2004 01:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.