+ Reply to Thread
Results 1 to 10 of 10

Need help in sending mail once button is clicked with table range

  1. #1
    Forum Contributor
    Join Date
    11-29-2018
    Location
    Chennai
    MS-Off Ver
    MS office 2010
    Posts
    233

    Need help in sending mail once button is clicked with table range

    Hi All,

    I would require help in integration to send mail with a table format. Baiscally if anybody enters their ID in the Main sheet and click send In mail, i want the corresponding ID to that person with To & CC has to be sent.

    In mail --> Sheet 3 Range A to C

    Out Mail --> Sheet 3 Range A to D

    I found this Outlook code, but i am unable to integrate how to send a table in the mail body provided in a range with the unique selection of ID. Please help for solution.

    Attaching a sample worksheet for reference

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Arunkumaramk; 07-23-2022 at 05:34 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Need help in sending mail once button is clicked with table range

    You can copy the range and paste it into outlook.

    Formatted range
    2022-07-23_4-30-37.jpg

    result
    -
    result.jpg

    -
    Code for your first button, change the range for your second button.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-29-2018
    Location
    Chennai
    MS-Off Ver
    MS office 2010
    Posts
    233

    Re: Need help in sending mail once button is clicked with table range

    Hi Dave,

    Thank you for the code. There is a little tweak required, i dont want the entire mail to go to all.

    If emp id is entered 123 then only the mail of Jack to be sent. And if its entered with 456 then only Jim mail to be sent.

    Can you please help in tweaking the same

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Need help in sending mail once button is clicked with table range

    It would help if you had the unique id on sheet 3 as well

  5. #5
    Forum Contributor
    Join Date
    11-29-2018
    Location
    Chennai
    MS-Off Ver
    MS office 2010
    Posts
    233

    Re: Need help in sending mail once button is clicked with table range

    Hi Dave,
    Yes, but I dont have the code to register the emp Id in sheet 3. However the name registered will be unique as per sheet 2.
    Can we cross verify with the name and get the mail sent out.

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Need help in sending mail once button is clicked with table range

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-29-2018
    Location
    Chennai
    MS-Off Ver
    MS office 2010
    Posts
    233

    Re: Need help in sending mail once button is clicked with table range

    Hi Dave,

    This code works clearly, however one more change is required. I am trying to incorporate the code in my actual worksheet but i m unable to link both the codes.

    I have already written the code to get the in time registered in sheet3 when the user clicks In. This gets stored on a daily basis in the sheet3. I want the In time button and the mail button to be incorporated in one single button, probably i believe i missed the function to call.

    Since this is daily activity which gets stored in sheet3, i want the latest e-mail to go whenever user clicks In.

    Say for example, 22nd they click in and the 1st msg goes out for In time and for Out time which is recorded with 22nd date and

    On 23rd user clicks in and i want the time which is recorded on 23rd to be sent out and not the time which is already there in 22nd.

    Apologies for not telling this condition before, since i tested now i came to know this. Please find my attached sample file.

    Really thank you for the time in getting this corrected.

    Thanks Dave
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    11-29-2018
    Location
    Chennai
    MS-Off Ver
    MS office 2010
    Posts
    233

    Re: Need help in sending mail once button is clicked with table range

    Hi Dave,
    Sorry for bothering you, can you please help me with the changes.

    I have incorporated the code u gave me yesterday, however i m getting error as

    "Jim is not found". I believe that the match function of the name didn't work. If you could check and confirm that i will will try and get it fixed.

    Thanks
    Last edited by Arunkumaramk; 07-24-2022 at 12:36 AM.

  9. #9
    Forum Contributor
    Join Date
    11-29-2018
    Location
    Chennai
    MS-Off Ver
    MS office 2010
    Posts
    233

    Re: Need help in sending mail once button is clicked with table range

    Hi Dave

    I have fixed the code myself. Hence marking this thread as solved.

    Thanks for the support.

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Need help in sending mail once button is clicked with table range

    You would need to find the last entered name in the data sheet.
    Please Login or Register  to view this content.
    Check out attached.
    Enter employee number in first cell, then click "in" or "out" button.
    There is a vlookup formula in B2:b4 that gets the info from Sheet2 for the name and email addresses.
    Attached Files Attached Files

+ 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. Sending Mail via VBA while auto fitting the table
    By GreenTee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2015, 02:44 PM
  2. Sending mail with range as body using GMAIL
    By vssoma in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2014, 05:40 AM
  3. [SOLVED] change range a table appears every time a button within a userform is clicked
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2013, 05:07 PM
  4. Sending mail depending upon the range of cells
    By manusharma11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2012, 05:24 PM
  5. [SOLVED] Sending a range as an image attached to an e-mail
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2006, 12:55 PM
  6. Replies: 0
    Last Post: 06-01-2005, 04:29 PM
  7. Sending e mail with attachment from button click
    By pmud in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2005, 07:06 PM

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