hello... i have a code below which works perfectly copying the contents in rage B4 to C4 to the email body but I need to remove the cells copy selection border from being shown in the excel sheet after copying the cells . Also, how can I control the row selection in this code? I think I need to change the xlDown to let say stop the selection at B30 and C30
any chance you can help me out guys? thanks in advance!
Sub CreateMail()
Dim objOutlook As Object
Dim objmail As Object
Dim rngTo As Range
Dim rngCc As Range
Dim rngSubject As Range
Dim rngBody As Range
Set objOutlook = CreateObject("Outlook.Application")
Set objmail = objOutlook.createitem(0)
With ActiveSheet
Set rngTo = .Range("B1")
Set rngCc = .Range("B2")
Set rngSubject = .Range("B3")
Set rngBody = .Range(.Range("B4"), .Range("C4").End(xlDown))
End With
rngBody.Copy
With objmail
.To = rngTo.Value
.CC = rngCc.Value
.Subject = rngSubject.Value
.Display
End With
SendKeys "^({v})", True
Set objOutlook = Nothing
Set objmail = Nothing
Set rngTo = Nothing
Set rngCc = Nothing
Set rngSubject = Nothing
Set rngBody = Nothing
End Sub
Bookmarks