ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro - Copy - Email (https://www.excelbanter.com/excel-worksheet-functions/15777-macro-copy-email.html)

John

Macro - Copy - Email
 
I have created a form that is sent to a department whenever a new account is
opened. The file is too big to send, so I am trying to copy to two
worksheets within the form, paste them into a new workbook and then send that
email.

Within the Macro it keeps putting the newest workbook (i.e. book15)
Whenever you want it to copy and paste into a new workbook, the workbook
number is going to be different. Is there a way in excel, within the macro,
to have it just put it into a new work book instead of a specific numbered
work book? I know this is confusing. I have included the macro in this
message to see if that would help.

Sheets("PEF").Copy
Windows("Copy of Master Form V3.00.xls").Activate
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
Sheets("Check Order").Copy
Application.Dialogs(xlDialogSendMail).Show
Windows("Book15").Activate
Application.Dialogs(xlDialogSendMail).Show
Windows("Copy of Master Form V3.00.xls").Activate
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
End Sub

Ron de Bruin

Hi John

See
http://www.rondebruin.nl/sendmail.htm

See also my Add-ins (very easy to use)
http://www.rondebruin.nl/mail/add-in.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl



"John" wrote in message ...
I have created a form that is sent to a department whenever a new account is
opened. The file is too big to send, so I am trying to copy to two
worksheets within the form, paste them into a new workbook and then send that
email.

Within the Macro it keeps putting the newest workbook (i.e. book15)
Whenever you want it to copy and paste into a new workbook, the workbook
number is going to be different. Is there a way in excel, within the macro,
to have it just put it into a new work book instead of a specific numbered
work book? I know this is confusing. I have included the macro in this
message to see if that would help.

Sheets("PEF").Copy
Windows("Copy of Master Form V3.00.xls").Activate
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Next.Select
Sheets("Check Order").Copy
Application.Dialogs(xlDialogSendMail).Show
Windows("Book15").Activate
Application.Dialogs(xlDialogSendMail).Show
Windows("Copy of Master Form V3.00.xls").Activate
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
ActiveSheet.Previous.Select
End Sub





All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com