What to do to help the next person after I am gone....

rickblunt

Well-known Member
Joined
Feb 18, 2008
Messages
609
Office Version
  1. 2019
Platform
  1. Windows
Hey there, Below is a snippet of code that I use to send email from my userforms for a variety of functions. And I use this code in hundreds of userforms and macros.

During a corporate audit this morning the question was asked of me of who will be maintaining the code in a few years when I retire. And I will admit I was stumped, but it got me thinking that maybe I should at least start planning for that. So I am wondering if there is a way that in the case of the email addresses, perhaps I can reference a couple of cells on a worksheet somewhere. That way whomever is in charge of keeping the workbook running, instead of adjusting the code; all they would have to do is to type in the new names onto the worksheet. Does that make sense? Not sure how I would do that though... Maybe there is a better way? I appreciate any input - thanks



Code:
' Show the envelope on the ActiveWorkbook.
    
    ActiveWorkbook.EnvelopeVisible = True
   
   
   With ActiveSheet.MailEnvelope
      .Introduction = " The following facility inspection has been completed. "
      .Item.To = "name1@company email;name2@company email"
      .Item.Subject = "Facility Inspection Completed"
      .Item.Send
   End With
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
.
Or perhaps your employer should be making plans for a replacement ? Hire someone part-time / full-time to learn what you have been and are doing ?

Ultimately, its really the employer's responsibility, not yours. Worst case scenario, you retire and they higher a new kid fresh from college/tech school. Things might
be tight for awhile but eventually the new guy will catch on.

As RedBeard said ... commenting your code is probably the best approach - even for the new kid.

ps: Include the Excel Forum url's in your code for the new guy to refer to. :laugh:
 
Last edited:
Upvote 0
I appreciate the input. I agree, ultimately its not my problem, but I hate to leave anyone hanging so I want to try to make it as easy as I can for them. It could be one of my team that I have been working with for years, and none of them are at all familiar with the VBA. So leaving the comments (which is what you normally do ;)) might not work because none of them even know what the editor is - lol.

Ultimately it turned out to be easier than I thought, all I had to do is the following, just had to make sure that all of the email addresses were in the same cell, separated by a semi-colon. I think that I will be trying to employ this for the rest of my codes going forward. Maybe a WS devoted to all of these kinds of things, it would be easier to change code for other things as well....

Code:
' Show the envelope on the ActiveWorkbook.
    
    ActiveWorkbook.EnvelopeVisible = True
   
   
   With ActiveSheet.MailEnvelope
      .Introduction = " The following facility inspection has been completed. "
      .Item.To = Range("Coding!U3").Value
      .Item.Subject = "Facility Inspection Completed"
      .Item.Send
   End With
 
Upvote 0

Forum statistics

Threads
1,223,725
Messages
6,174,128
Members
452,546
Latest member
Rafafa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top