![]() ![]() However, Sheet1 includes some references, in formulas, to cells in Sheet2 and Sheet3. For instance, let's say that you want to copy and e-mail Sheet1 from the original workbook. There is one potential drawback to using the approach detailed in this tip: When you create a copy of the worksheet to a new workbook, Excel can do some funny things with some references that may be in the copied worksheet. HOW TO USE MACROS IN EXCEL TO SEND EMAIL FOR MAC CODEIf you would prefer to have the workbook saved elsewhere (or if your system restrictions stop you from saving files to the root directory of your system), simply change the location in the two lines of code that reference the C: drive. The macro saves the temporary workbook (the one being e-mailed) to the C: drive. It then deletes the workbook and returns you to your normal use of Excel. Note that the macro does effectively what was done in the earlier steps: it copies the worksheet to a new workbook and then e-mails that workbook. 'Restore screen updating and release Outlook '.body = "Dear John" & vbCrLf & vbCrLf & _ ![]() 'Uncomment the lines below to hard code a body '.To = the line below to hard code a subject 'Uncomment the line below to hard code a recipient Set oApp = CreateObject("Outlook.Application") However, it may be instructive to provide an example of a macro that can e-mail a worksheet using Outlook as the mail program. For this reason, it is not possible to provide a comprehensive macro-based answer in this tip. The macro you create will vary, depending on the e-mail program you are using. If you need to routinely e-mail the current worksheet to someone else, you may want to create a macro that will do the task for you. Once it is e-mailed, you can delete the workbook from your system, as your worksheet is still in the original workbook, as well. Save this workbook and e-mail it, and you've accomplished what you wanted to do.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |