I am somewhat new using VB codes. I am trying to set up a small spreadsheet for inventory,that way when a certain range falls below a reorder point, an email will be generated to reorder more.The only thing I need to know is how to email the contents of cell (example D2 thru G2)? The code I included is sending the email but only sends the amount the inventory is changed to.
Below is what I have so far.
Thanks for any help
[vba]Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$H$2" Then
If Target.Value < 6 Then
If MsgBox("Confirm Reorder of Tooling", vbQuestion Or vbYesNo) = vbYes Then
EmailNotify "Out of stock cutters ", Target.Value
End If
End If
End If
End Sub
Public Sub EmailNotify(SubjectText As String, BodyText As String)
Dim appOL As Object
Dim objMail As Object
Const EMAIL_ADDRESS = "Email address.com"
Set appOL = CreateObject("Outlook.Application")
Set objMail = appOL.CreateItem(0) ' olmailitem=0
With objMail
.Recipients.Add EMAIL_ADDRESS
.Subject = reorder
.Body = BodyText
.Send
End With
Set objMail = Nothing
Set appOL = Nothing
End Sub[/vba]