+ Reply to Thread
Results 1 to 8 of 8

E-mail last row of data in workbook

  1. #1
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Post E-mail last row of data in workbook

    Hi Everyone, I posted this before the holidays and had a suggestion back however I'm having some trouble getting things to work together.
    [URL="http://www.excelforum.com/excel-programming-vba-macros/976482-e-mail-last-row-of-data-in-workbook.html#post3519561[/URL]
    What I am trying to achieve is, to be able to e-mail (using outlook) the last new line of data from sheet1 in my workbook. The error message I am getting is "The source is out of range" I have tried setting the source range in a couple of ways but keep getting error messages. Any help will be very appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    12-19-2012
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: E-mail last row of data in workbook

    Hi,

    Im not an expert, more of a novice but may i suggest try defining variable "wb" before you set source, as i believe set source line calls this variable?

    i.e.
    On Error Resume Next
    Set wb = ActiveWorkbook
    Set Source = wb(Sheet1).UsedRange.Row(wb(Sheet1).UsedRange.Rows.Count)

    Regards
    Steve
    Last edited by Steve@Rugby; 01-02-2014 at 08:00 AM. Reason: spelling!!!

  3. #3
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: E-mail last row of data in workbook

    Thank you very much for the reply. The "wb" variable was defined in my list of variables.
    Please Login or Register  to view this content.
    I've given it a go in the place you suggested, and added "Active" but I don't believe moving the variable position makes any difference.
    Thank you anyways.

  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: E-mail last row of data in workbook

    as an option try this one!
    Attached Files Attached Files
    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-

  5. #5
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: E-mail last row of data in workbook

    Thank you very much for the last post. I like the approach, the thing, is there a way for the new sheet created to be automatically attached to the e-mail or am I supposed to add it each time. FYI I'm using office 2003. I have gone through the code in break mode and it doesn't execute the last section of the code, instead jumps back up to .diplay (before the function)

    This is where it breaks;

    Please Login or Register  to view this content.
    Sorry I don't know enough about what its doing to try and remedy this myself.
    Thank you again for the help.

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

    Re: E-mail last row of data in workbook

    if you want to attache the sheet try this
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: E-mail last row of data in workbook

    Thank you so much for all your help on this issue. The solution works great. Thank you and Happy New Year!

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

    Re: E-mail last row of data in workbook

    Glad I could help you! Thx for the rep!
    if you are happy with the solution provided, please mark the thread as "Solved"! thx!

    cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] E-mail last row of data in workbook
    By beenbee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2014, 09:04 AM
  2. Mail variable number of sheets in workbook based on VLOOKUP mail address
    By Tino XXL in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2013, 08:44 AM
  3. E-Mail workbook
    By robertrichardson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2013, 05:46 AM
  4. How to e-mail selected row and use e-mail address in a cell to send e-mail from excel
    By syedalamgir in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-27-2010, 02:15 AM
  5. Copy four worksheets from one workbook into a new workbook.e-mail
    By Francis Brown in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2005, 08:05 PM

Tags for this Thread

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