+ Reply to Thread
Results 1 to 4 of 4

Email .Send or .Display as a declared variable

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    Shipley, UK
    MS-Off Ver
    Excel 2010
    Posts
    69

    Email .Send or .Display as a declared variable

    Hi All,

    I have a script that either sends or displays several emails, however, when testing additions to the script, I would like to declare one variable to return .Send or .Display, to avoid having to change several sections from .Send to .Display.

    I've tried

    Please Login or Register  to view this content.
    Any advice would be greatly appreciated

    Many thanks

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Email .Send or .Display as a declared variable

    The simplest way would be to use something like a Boolean variable and then just test it:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Email .Send or .Display as a declared variable

    you'll need to trigger it somehow.
    If you run the script from a userform, you could add an object (listbox with 2 items , 1 checkbox "Send" , combobox with choices) to select the required action.
    Set that action to the variable so it has the chosen action before you actually run the mailing part.
    The boolean option from #2 (rorya) could be easely be added to a checkbox
    Even a little help can be a big help !!
    1. A sample workbook says more then words. Add problem description and solution so we can understand the problem.
    2. Your appreciation is accepted by clicking the star "Add Reputation" at the lower left of the post.
    3. If your problem is solved, mark it as [SOLVED]: See "FAQ : " https://www.excelforum.com/faq.php
    4. Use [CODE] [/CODE] tags to illustrate your code: see here

  4. #4
    Registered User
    Join Date
    08-06-2012
    Location
    Shipley, UK
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Email .Send or .Display as a declared variable

    Makes sense, just couldn't think this morning, thanks

+ 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. Refresh an already declared variable
    By EchoPassenger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2016, 04:56 AM
  2. [SOLVED] Display email vs Send
    By Wheelie686 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2016, 10:14 PM
  3. Screen capture from another application display to send as email body
    By ida tjio in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2014, 04:31 AM
  4. Workflow with signatures (if cell=x then send email, if signed then send email)
    By Kate2811 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2014, 05:37 AM
  5. VBA Code To Display Email Instead Of Automatically Send
    By alulla in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-28-2013, 01:59 PM
  6. [SOLVED] Global variable declared in Userform. Variable value is not sticking
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-25-2012, 08:50 AM
  7. Non-declared variable
    By mqdias in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2007, 10:01 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