Hello, im trying to figure out how to make this code better. currently the code only takes one row,since its based on cell position.
Is it possible to make a code that would put the whole table in the mail instead of just one row.
Code:
Dim i As Integer, Mail_Object, Email_Subject, o As Variant
Dim TypeS As String
TypeS = ActiveSheet.ListObjects("Orderoversikt").ListColumns(1).Range.Column
Set Mail_Object = CreateObject("Outlook.Application")
With Mail_Object.CreateItem(o)
.Subject = ActiveSheet.ListObjects("Orderoversikt")
.To = "Mail"
.cc = "frommail"
.Body = "cell1: " & ActiveSheet.Range("r4").Value & Chr(13) & Chr(10) & "cell2: " & ActiveSheet.Range("S4").Value & Chr(13) & Chr(10) & "cell3: " & ActiveSheet.Range("t4").Value & Chr(13) & Chr(10) & "cell4:" & ActiveSheet.Range("u4").Value & Chr(13) & Chr(10) & "cell5: " & ActiveSheet.Range("v4").Value & Chr(13) & Chr(10) & "cell6: " & ActiveSheet.Range("w4").Value
.Display
End With
Application.DisplayAlerts = False
Set Mail_Object = Nothing
End Sub