+ Reply to Thread
Results 1 to 4 of 4

Sending a worksheet through email by VBA

  1. #1
    Registered User
    Join Date
    01-17-2009
    Location
    dunfermline, scotland
    MS-Off Ver
    Excel 2003
    Posts
    8

    Sending a worksheet through email by VBA

    Hello,

    I have the following piece of code that copies the active excel sheet in a workbook and saves it to a temporary file in preparation for it being sent via email. I need to modify the code to select a named sheet instead of the active sheet. Would appreciate a few pointers.

    Please Login or Register  to view this content.
    ActiveSheet.Copy
    Set WB = ActiveWorkbook
    FileName = Range("Subject") & " Text.xls"
    On Error Resume Next
    Kill "C:\" & FileName
    On Error Goto 0
    WB.SaveAs FileName:="C:\" & FileName

    Please Login or Register  to view this content.
    cheers
    Last edited by getshorty; 04-03-2012 at 01:19 PM. Reason: Have inserted code tags but dont see usual screen

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: Sending a worksheet through email by VBA

    not sure, but try..
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Registered User
    Join Date
    01-17-2009
    Location
    dunfermline, scotland
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Sending a worksheet through email by VBA

    Thanks John, it works well

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: Sending a worksheet through email by VBA

    hi,
    you're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1