VBA event to 1) print now, 2) print username & 3) prevent deletion

  • Hi guys, I hope everything is going well with you.

    Look, I need your help please.

    Please check the attached.

    I need to create Save event. So, once the sheet is saved, the file acts as follows:

    • Type the date and time (NOW function) in the active row, second cell.
    • Type the username (Environ username, I guess) in the active row, seventh cell.
    • The last thing to auto-close the sheet once these commands are completed and the sheet is saved, however, and that’s the challenging thing that I’m not really sure if it’s doable, I want the sheet once it’s re-opened again, I need the lastly added row to be, editable yes, but not removable, like a footprint.


    Could someone help with the code writing? I’m familiar with the needed functions for the first two points, yet, I’m not that good to write the code, and for point# 3, I don’t know at all how to do it or what to use.

    Thank you guys.

  • Hello,


    Instead of listing your own series of ' solutions ' ... you should first describe your problem and your objective ...


    This would allow contributors to come up with proposals which would best fit your requirements ...


    For example :


    1. ' active row ' - second cell means Column B ... but your sheet will ONLY have one row ... so why have you prepared 427 rows ?


    2. ' active row ' - seventh cell ... do you mean Column G ?


    3. prevent deletion of the last row ... why only the last row ? is there a difference between ' active row ' and ' last row ' ?


    P.S. Your title says ' Print ' ... do you really mean Print ... or do you mean Input ...?

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Hi Carim, Thank you for your prompt reply.


    I assume by attaching the sample sheet, I'm clarifying the aspect of the needs already, however, let me elaborate by answering your validating points:


    1. ' active row ' - second cell means Column B ... but your sheet will ONLY have one row ... so why have you prepared 427 rows ?
    Because each time the sheet will be re-opened, another row will be used and it will be the active row in this case.


    2. ' active row ' - seventh cell ... do you mean Column G ?
    Yes, I do


    3. prevent deletion of the last row ... why only the last row ? is there a difference between ' active row ' and ' last row ' ?
    I meant the active row, yes, I'm sorry.


    P.S. Your title says ' Print ' ... do you really mean Print ... or do you mean Input ...?
    I meant input, yes, I'm sorry.



    If you've a different solution suggestions than the presented, they're truly welcomed.


    Thank you.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!