Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
hi I have the 2 codes below but i want them to be added into the same module, as the count code below is in a command button and the email one is in a module how can i combine both codes into the module please?
Code:
Private Sub CommandButton8_Click()
Range("Z1").Value = Range("Z1").Value + 1
End Sub
HTML:
Sub Mail_Selection_Range_Outlook_Body()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Set rng = Nothing
' Only send the visible cells in the selection.
Set rng = Sheets("Handover").Range("H5:M5").SpecialCells(xlCellTypeVisible)
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = ThisWorkbook.Sheets("Email Links").Range("A2").Value
.CC = ""
.BCC = ""
.Subject = "Chaser please on this job as the MT has called"
.HTMLBody = RangetoHTML(rng)
.Display
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub