+ Reply to Thread
Results 1 to 9 of 9

Data Validation Paired with VBA Email Macro

  1. #1
    Registered User
    Join Date
    06-26-2015
    Location
    St.Paul, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    37

    Data Validation Paired with VBA Email Macro

    Hi,

    I've got an email macro that generates an email to a particular company from a dropdown selection. When an Email is sent, another macro button is clicked to record the date in a " Date Sent" column on another sheet for that particular company. I'm wondering if i can attach a data validation to the to Email macro that would generate a popup alert to the user when they attempt to send an email to a company if that company already has a date stamp recorded in the "Date Sent" in its respective row. Thanks in advance! Here's the email code:
    Please Login or Register  to view this content.
    And this is the Date Stamp Code:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation Paired with VBA Email Macro

    i don't really know how your data is setup but if you want to check the a range before sending

    just insert an IF statement at the start of your mail_workbook code before you enter the first lot of SET lines

    Please Login or Register  to view this content.
    sorry if its vague but without knowing anything about the sheet this is really best can do
    if you want something more inline with what you want

    Create a sample worksheet in which you can share (with santised data of course) and attach
    Last edited by humdingaling; 07-02-2015 at 10:25 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    06-26-2015
    Location
    St.Paul, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Data Validation Paired with VBA Email Macro

    Here's the related worksheets. The "email Sheet" will be populated with the company name and email credentials, and the "Current Clients" sheet is where I record the date stamp with the two buttons on the right in the "Email Sheet". Let me know if this helps. Line Ticklers by responsibility excel.xlsm

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation Paired with VBA Email Macro

    if i'm understanding what you trying to do

    Please Login or Register  to view this content.
    This codes does not check the date sent...only that there is a date
    i think you would need another if statement to check the date if you want say within last 10 days or something
    Attached Files Attached Files
    Last edited by humdingaling; 07-05-2015 at 08:45 PM.

  5. #5
    Registered User
    Join Date
    06-26-2015
    Location
    St.Paul, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Data Validation Paired with VBA Email Macro

    Thanks! It's working just fine.
    What would I have to add to the code if I wanted the message to include the "Date Recieved" information as well only if there was a value in that column. Thanks again.
    Last edited by murp5972; 07-06-2015 at 11:01 AM.

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation Paired with VBA Email Macro

    add
    Please Login or Register  to view this content.
    in the msgbox

  7. #7
    Registered User
    Join Date
    06-26-2015
    Location
    St.Paul, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Data Validation Paired with VBA Email Macro

    I only want a "Date Recieved" message to be included only when there is actually a date value in the recieved column. If the recieved column is blank, then I don't want that particular "Date Recieved" line inlcuded in the message. How would this be done? This is what the code looks like currently:

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation Paired with VBA Email Macro

    add another IF to check offset(,-1)

    Please Login or Register  to view this content.
    i dont know what you want for your message but the base is there so you should be able to fix as you like
    Last edited by humdingaling; 07-06-2015 at 08:09 PM. Reason: additional comments

  9. #9
    Registered User
    Join Date
    06-26-2015
    Location
    St.Paul, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Data Validation Paired with VBA Email Macro

    Great, 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. [SOLVED] Email Validation Macro
    By DrNo1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-26-2023, 12:43 AM
  2. Data Validation Paired with VBA Email Macro
    By murp5972 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2015, 11:38 AM
  3. Run formulae on paired data
    By batman98347 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-22-2015, 05:02 PM
  4. Need Vlookup/If/Macro/? to Return Multiple Paired Matches
    By odbal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2014, 05:40 PM
  5. 2003 Validation Dependencies email macro
    By andtheboat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2010, 11:55 AM

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