ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Need a macro to Copy a selection and paste into a new email. (https://www.excelbanter.com/excel-discussion-misc-queries/72610-need-macro-copy-selection-paste-into-new-email.html)

Koolmist

Need a macro to Copy a selection and paste into a new email.
 
Hey all,
I am extremely new to Excel and have been "tinkering" with it for around
2 weeks now, and have come to the conclussion that i need to start learning
macros. I have recently been given a task of making a worksheet that gathers
data from multiple sheets and places that info into a single sheet once an
hour. Although the process I used was more than likely the least efficient it
still works fine. The data is recorded for each hour and via formulas
populates a "Reports" sheet. I need to learn how to make a macro that will
copy a selection on the "Reports" sheet, paste it into a new e-mail and sent
it from clicking on a single button. I figured out how to make a button from
reading the posts in this forum, but am at a loss as to how to make a macro
that will change sheets, select a range of cells,copy it, then open Outlook,
make a new email, paste it, send it, and then return to the original sheet,
but to cells below the ones previously filled in. Any and all assistance
would be greatly appreciated, as I am eager to see this sheet finally
finished.

Anne Troy

Need a macro to Copy a selection and paste into a new email.
 
Bookmark Ron's site for anything to do with Excel and emailing:
http://www.rondebruin.nl/sendmail.htm
:)
************
Hope it helps!
Anne Troy
www.OfficeArticles.com
Check out the NEWsgroup stats!
Check out: www.ExcelUserConference.com

"Koolmist" wrote in message
...
Hey all,
I am extremely new to Excel and have been "tinkering" with it for
around
2 weeks now, and have come to the conclussion that i need to start
learning
macros. I have recently been given a task of making a worksheet that
gathers
data from multiple sheets and places that info into a single sheet once an
hour. Although the process I used was more than likely the least efficient
it
still works fine. The data is recorded for each hour and via formulas
populates a "Reports" sheet. I need to learn how to make a macro that will
copy a selection on the "Reports" sheet, paste it into a new e-mail and
sent
it from clicking on a single button. I figured out how to make a button
from
reading the posts in this forum, but am at a loss as to how to make a
macro
that will change sheets, select a range of cells,copy it, then open
Outlook,
make a new email, paste it, send it, and then return to the original
sheet,
but to cells below the ones previously filled in. Any and all assistance
would be greatly appreciated, as I am eager to see this sheet finally
finished.




Koolmist

Need a macro to Copy a selection and paste into a new email.
 
I checked out his site but since I have no idea how to read this code what so
ever its greek to me. I did how ever figure out some of the code and have
gotten the Button to copy the appropiate cells, open a new email and fill the
subject line. I have run into a problem though. I don't know how to get it to
paste. I know I must change the .Display to .Send when I get it to work, but
how do i get it to paste in the body of the email??

Sub Email6()
'
' Email6 Macro
' Macro recorded 2/19/2006 by clawson
'

'
Sheets("Report").Select
Range("A49:K96").Select
Selection.Copy

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = "Sick; GTW Managment"
.BCC = ""
.Subject = "6AM Heads-up Report"
.HTMLBody = RangetoHTML
.Display
End With

Sheets("Data Sheet").Select
Set OutMail = Nothing
Set OutApp = Nothing

End Sub

Again thanks for all of the help it's so close to being finished!!

"Anne Troy" wrote:

Bookmark Ron's site for anything to do with Excel and emailing:
http://www.rondebruin.nl/sendmail.htm
:)
************
Hope it helps!
Anne Troy
www.OfficeArticles.com
Check out the NEWsgroup stats!
Check out: www.ExcelUserConference.com

"Koolmist" wrote in message
...
Hey all,
I am extremely new to Excel and have been "tinkering" with it for
around
2 weeks now, and have come to the conclussion that i need to start
learning
macros. I have recently been given a task of making a worksheet that
gathers
data from multiple sheets and places that info into a single sheet once an
hour. Although the process I used was more than likely the least efficient
it
still works fine. The data is recorded for each hour and via formulas
populates a "Reports" sheet. I need to learn how to make a macro that will
copy a selection on the "Reports" sheet, paste it into a new e-mail and
sent
it from clicking on a single button. I figured out how to make a button
from
reading the posts in this forum, but am at a loss as to how to make a
macro
that will change sheets, select a range of cells,copy it, then open
Outlook,
make a new email, paste it, send it, and then return to the original
sheet,
but to cells below the ones previously filled in. Any and all assistance
would be greatly appreciated, as I am eager to see this sheet finally
finished.





Ron de Bruin

Need a macro to Copy a selection and paste into a new email.
 
Hi Koolmist

Have you try this example
http://www.rondebruin.nl/mail/folder3/mail4.htm



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


"Koolmist" wrote in message ...
I checked out his site but since I have no idea how to read this code what so
ever its greek to me. I did how ever figure out some of the code and have
gotten the Button to copy the appropiate cells, open a new email and fill the
subject line. I have run into a problem though. I don't know how to get it to
paste. I know I must change the .Display to .Send when I get it to work, but
how do i get it to paste in the body of the email??

Sub Email6()
'
' Email6 Macro
' Macro recorded 2/19/2006 by clawson
'

'
Sheets("Report").Select
Range("A49:K96").Select
Selection.Copy

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = "Sick; GTW Managment"
.BCC = ""
.Subject = "6AM Heads-up Report"
.HTMLBody = RangetoHTML
.Display
End With

Sheets("Data Sheet").Select
Set OutMail = Nothing
Set OutApp = Nothing

End Sub

Again thanks for all of the help it's so close to being finished!!

"Anne Troy" wrote:

Bookmark Ron's site for anything to do with Excel and emailing:
http://www.rondebruin.nl/sendmail.htm
:)
************
Hope it helps!
Anne Troy
www.OfficeArticles.com
Check out the NEWsgroup stats!
Check out: www.ExcelUserConference.com

"Koolmist" wrote in message
...
Hey all,
I am extremely new to Excel and have been "tinkering" with it for
around
2 weeks now, and have come to the conclussion that i need to start
learning
macros. I have recently been given a task of making a worksheet that
gathers
data from multiple sheets and places that info into a single sheet once an
hour. Although the process I used was more than likely the least efficient
it
still works fine. The data is recorded for each hour and via formulas
populates a "Reports" sheet. I need to learn how to make a macro that will
copy a selection on the "Reports" sheet, paste it into a new e-mail and
sent
it from clicking on a single button. I figured out how to make a button
from
reading the posts in this forum, but am at a loss as to how to make a
macro
that will change sheets, select a range of cells,copy it, then open
Outlook,
make a new email, paste it, send it, and then return to the original
sheet,
but to cells below the ones previously filled in. Any and all assistance
would be greatly appreciated, as I am eager to see this sheet finally
finished.








All times are GMT +1. The time now is 01:25 PM.

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