You can send an SMS message by sending an email if you know the person's cell phone service provider and SMS gateway domain of the service provider. For example, if you look at the line in red in the code below, I have used a dummy 10 digit phone number and the SMS gateway domain for Bell Canada. Have a look at this link for the SMS gateway domains of most service providers: https://en.wikipedia.org/wiki/SMS_gateway
Change the phone number and gateway domain to suit your needs. You can test the macro by inserting the information for your own cell number.
![]()
Private Sub CommandButton1_Click() Application.ScreenUpdating = False Dim LastRow As Long, ws As Worksheet Dim OutApp As Object, OutMail As Object Set ws = Sheets("Data") LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row + 1 'Finds the last blank row ws.Range("A" & LastRow).Value = ComboBox1.Text 'Adds the TextBox3 into Col A & Last Blank Row ws.Range("B" & LastRow).Value = ComboBox2.Text ws.Range("C" & LastRow).Value = ComboBox3.Text ws.Range("D" & LastRow).Value = TextBox1.Text ws.Range("E" & LastRow).Value = TextBox2.Text If ComboBox3.Text = "Unsafe" Then Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .To = "1234567890@txt.bell.ca" .Subject = "Unsafe condition reported" .HTMLBody = ComboBox1.Text & " is reporting an unsafe condition." & vbNewLine & _ "Location: " & ComboBox2.Text & vbNewLine & _ "Details :" & TextBox1.Text & vbNewLine & _ "Outcome: " & TextBox2.Text & vbNewLine .send End With End If Application.ScreenUpdating = True End Sub
Bookmarks