+ Reply to Thread
Results 1 to 32 of 32

insert in a macro mail inputbox

  1. #1
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    insert in a macro mail inputbox

    Hello everybody,
    it is possible to insert an input box in a .To mail to choose the recipients which are in column S
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Insert here

    .to = "[email protected]" '<<< destinatari

    a inputbox for choose recipients in column S

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Hi logit,

    .to = emailAddr

    How does this work?


    i can't try the macro here at home, i have excel 2007.
    In the my office i have excel 365.
    How is the macro set up does it work with excel 365?

  5. #5
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    But with this I can choose between the names of column S or I have to put the names by hand...

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Input the email address manually.

  7. #7
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    it is possible to insert a drop-down menu to choose the names that are in the range S5:S5
    or with define name = utenti (range S5:S50)

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Is the ultimate goal to select ONE EMAIL ADDRESS ... or are you wanting the ability to
    select MORE THAN ONE address to be included in the email TO FIELD ?

  9. #9
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Yes logit

    Is the ultimate goal to select ONE EMAIL ADDRESS ... or are you wanting the ability to
    select MORE THAN ONE address to be included in the email TO FIELD

    the mail andress are in the range S5:S50

  10. #10
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    On the net i found this.

    Please Login or Register  to view this content.
    Here at home I don't have the opportunity to try the macro I have excel 2007

    I entered this change twice
    once per .To
    once for .CC
    it's right?


    Please Login or Register  to view this content.

  11. #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Ok ... I've been trying to use your existing workbook and code for the purposes of editing to obtain the goal you are seeking.

    I have not looked at your last post with the new code. Sorry.

    The following does work with your existing workbook. But I removed most all of your existing code just to get it to work
    as you are wanting. You will need to add back in the other lines of code.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    I don't have a chance to try the macro
    but in
    .To = toList
    how many users / names are there?

  13. #13
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Looking at the attached workbook download .... you will need to double click the cell in Column R adjacent to the email address in Column S that you want the
    email sent to. It's like checking off which email addresses you want the email to be sent.

    When you double click the cell in Column R again, the check mark goes away. It's an easy method to select and de-select the email addresses you want.

    Try the workbook.

  14. #14
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Now I have seen how it works with double click that I had not seen
    I made a change (which doesn't work)

    I also added
    .To = toList1
    .CC = toList2 '<<<<

    mistake here

    Next i1
    Next i2

    error here too for double click

    Private Sub Worksheet_BeforeDoubleClick( _
    ByVal Target As Range, Cancel As Boolean)
    Dim rInt As Range
    Dim rCell As Range

    Set rInt = Intersect(Target, Range("R5:R500"))
    Set rInt = Intersect(Target, Range("T5:T500")) '<<<<<<

    If Not rInt Is Nothing Then
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Hi,
    hello i corrected is correct?

    why does double_click no longer work in all cells of the sheet?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by john_cash; 10-11-2020 at 03:18 AM.

  16. #16
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    I just ran your attached workbook.

    The double-click runs fine here.

  17. #17
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    The double click it must work in all cells now with the macro

    Private Sub Worksheet_BeforeDoubleClick( _
    ByVal Target As Range, Cancel As Boolean)

    it works only in macro cells in all others the sheet is disabled

  18. #18
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Sorry ... everything works here.

    I don't what to advise why it doesn't work there.

  19. #19
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    In the attached file in sheet 2 double_click works
    in sheet 1 only in the yellow columns
    Attached Files Attached Files

  20. #20
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Paste the same code in the Sheet2 module :

    Please Login or Register  to view this content.

  21. #21
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Maybe I mean it wrong.
    The double_click of the mouse does not work in sheets with macros.
    It only works in cells inserted into macros

  22. #22
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Sorry for the confusion. I know you are trying to explain as best as you can ... however, I don't understand
    what you mean.

    Please try explaining a different way.

  23. #23
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Hi logit
    I tried the macro Sub eMail() in the my office with excel 365 but sending does not work

    error does not enter names in outlook
    Attached Files Attached Files
    Last edited by john_cash; 10-12-2020 at 03:07 AM.

  24. #24
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Try this edited version of a previous macro I posted. Look at the .CC = field in the code.
    Run the attached example :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  25. #25
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    .CC

    not double click?

  26. #26
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    No. Simply enter the email address you want in the column as shown in the example workbook.

  27. #27
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Hi logit,
    this macro it's your first post #11 modified

    Please Login or Register  to view this content.
    because

    compilation error
    invalid reference to next control variable

    here

    Next i '<<<<
    Next j
    Attached Files Attached Files

  28. #28
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    I recommend to not return to your latest version of the macro.

    Take the last posted version (Post #24) and re-build from there ... adding in the other code EXCEPT leaving out the DOUBLE CLICK for the CC EMAIL.

  29. #29
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    O.k. logit
    tomorrow I edit your new macro

  30. #30
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Hi logit
    i edited your new macro.
    I inserted my part of the macro inserted in the ===
    I think I have something wrong.
    Now Outlook does not appear and the attachment must be inserted.
    john
    Attached Files Attached Files

  31. #31
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: insert in a macro mail inputbox

    .
    Disregard all previous macro code.

    Paste this into a REGULAR MODULE :

    Please Login or Register  to view this content.
    Create a new folder on your desktop and name it EMAIL

    Place the attached workbook in that folder.

    Refer to attached file ....
    Attached Files Attached Files

  32. #32
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: insert in a macro mail inputbox

    Hi logit,
    tomorrow I try the new modification.
    thank you

+ 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] MACRO: If user clicks cancel in inputbox,then do nothing. Problem with inputbox appearance
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-05-2015, 04:33 AM
  2. Macro to insert one or more files after searching to mail as attachment
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2014, 07:09 AM
  3. Macro to insert a TOC after Mail Merge to new document from Excel vba
    By nickveeken in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2014, 04:56 AM
  4. [SOLVED] Manually insert Word Document Path via a InputBox in a Macro
    By Devianey26 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-17-2013, 02:57 PM
  5. Add Code to exisitng macro to insert HTML signature into e-mail
    By Lbischoff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2013, 12:01 PM
  6. [SOLVED] How to insert space lines in mail body content on a macro
    By nomis6565 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2012, 03:17 PM
  7. Insert row macro? or inputbox macro?
    By Santiago11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2011, 06:28 AM

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