+ Reply to Thread
Results 1 to 14 of 14

VBA for Email and Modification date/user

  1. #1
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    VBA for Email and Modification date/user

    Hi..I am quite a newbie when it comes to VBA..

    I have this project that every time I made changes to my excel file, the following will happen:

    1. Send an auto email (I am using outlook) with notifications of changes.
    2. Will create a log in a separate sheet on who last modified and time modified.

    I found 2 scripts but I am facing some problem because both are using "Workbook_BeforeSave"

    Below are the codes I intend to use:

    FIRST CODE:

    Please Login or Register  to view this content.
    SECOND CODE:

    Please Login or Register  to view this content.
    How do I combine these 2 scripts in one?
    Last edited by iamreese; 11-08-2011 at 11:04 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VBA for Email and Modification date/user

    Hi,

    Please take a moment to read the forum rules and add code tags to your post.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: VBA for Email and Modification date/user

    ^^^opps I'm bad..sorry about that..anyway I edited my first post..thanks again for the reminder..

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VBA for Email and Modification date/user

    One is using a Before_Save event and the other an Open event so don't actually need to be combined. If you wanted to though it would just be like this:

    Please Login or Register  to view this content.

    Dom

  5. #5
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: VBA for Email and Modification date/user

    Thanks for that quick reply and it actually worked but I need to know who modified it:

    what if I use the second script below to combine to the first script (email). How do I make them as one?

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

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VBA for Email and Modification date/user

    The second script you've quoted now logs every change that anyone makes to any cell on a sheet. I'm sure you don't want an email each time that happens. If you just want the ID, date and time of the person saving the document:

    Please Login or Register  to view this content.

    Dom

  7. #7
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: VBA for Email and Modification date/user

    Thanks a lot Domskie..just what I need!

  8. #8
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    [SOLVED] VBA for Email and Modification date/user

    MY query is solved! Thanks a bunch and more power on this forum

  9. #9
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: VBA for Email and Modification date/user

    Just a followup question..

    For the email notification, is it possible to be an optional for the user to send an email? and not automatic..although this is a least of my concern but just happened to cross my mind

  10. #10
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VBA for Email and Modification date/user

    Sure:

    Please Login or Register  to view this content.

    I've updated the code a bit too.

    Dom

  11. #11
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: VBA for Email and Modification date/user

    and that was super fast...Thanks a lot Dom for your continued assistance. I really appreciate it!

  12. #12
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: VBA for Email and Modification date/user

    Dom, with your code above, i want to combine the auto uppercase command using this code on specific column (column B to column CN)

    Please Login or Register  to view this content.

  13. #13
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VBA for Email and Modification date/user

    That's a worksheet level event code so should go on the relevent sheet's code page.

    Just set the column to change here:

    Please Login or Register  to view this content.

    Dom

  14. #14
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: VBA for Email and Modification date/user

    Domski I am learning a lot from you. As always, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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