Fix Excel VBA WhatsApp Messages Sending Only to the First Number
Question details
The user needs an Excel VBA routine to process a list of phone numbers and WhatsApp messages rather than stopping after the first entry.

- Product
- Microsoft Excel VBA and WhatsApp
- Device & OS
- not provided
- Scenario
- An Excel worksheet contains multiple recipients and messages to open in WhatsApp.
- Observed behavior
- The automation sends only the first message to the first phone number.
Put phone numbers in column A and messages in column B, starting on row 2. Store numbers as text using the international format with country code and digits only, and sign in to WhatsApp Web or your WhatsApp desktop app.
Loop Through Excel Rows and Confirm Each WhatsApp Send
Use this approach to open a separate WhatsApp chat for each valid row and prevent the loop from racing ahead before you send the message.
The example opens a prefilled WhatsApp chat; it does not press Send automatically. Send each message yourself, then return to Excel and confirm before the macro opens the next chat.
The example uses ENCODEURL in Windows desktop Excel. Very long messages can exceed link or browser limits; shorten or split them, or consider an authorized WhatsApp Business Platform integration.
In Excel, open the worksheet with your list, press Alt+F11, and select Insert > Module. Enable macros only if you trust the workbook and its code.
Paste the following code into the module: Sub OpenWhatsAppMessages() Dim ws As Worksheet Dim lastRow As Long, r As Long Dim phone As String, msg As String, link As String Set ws = ActiveSheet lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row For r = 2 To lastRow On Error GoTo RowError phone = Trim$(CStr(ws.Cells(r, "A").Value2)) msg = CStr(ws.Cells(r, "B").Value2) If Len(phone) = 0 Or phone Like "*[!0-9]*" Or Len(Trim$(msg)) = 0 Then MsgBox "Check the number and message on row " & r & ".", vbExclamation GoTo NextRow End If link = "https://wa.me/" & phone & "?text=" & Application.WorksheetFunction.EncodeURL(msg) ThisWorkbook.FollowHyperlink Address:=link If MsgBox("Send the message for row " & r & " in WhatsApp, then click OK to continue. Click Cancel to stop.", vbOKCancel + vbInformation) = vbCancel Then Exit Sub GoTo NextRow RowError: MsgBox "Could not open row " & r & ": " & Err.Description, vbExclamation Resume NextRow NextRow: On Error GoTo 0 Next r End Sub
Return to the worksheet, select Developer > Macros, choose OpenWhatsAppMessages, and click Run. Wait for each chat to load, check the recipient and message, click Send in WhatsApp, and then click OK in Excel to continue.
If Excel reports an invalid row or an error, check columns A and B for missing values, non-digit characters in the number, or a message that is too long. Correct the row before running the macro again.

Manage Your Message List in WPS Spreadsheet
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open compatible Excel files and organize recipient lists in WPS Spreadsheet; Excel VBA automation may require separate compatibility checks and is not repaired by switching apps.

Frequently Asked Questions
Why does my macro stop after the first WhatsApp message?
The send or link-opening action may be outside the row loop, the loop may be exiting early, or an error may stop execution. In the VBA editor, check the For loop and error handling, then step through the code with F8.
Does a wa.me link send the message automatically?
No. A wa.me link opens a chat with the encoded text prefilled. Wait for WhatsApp to load, review the recipient and message, and click Send yourself.
How should I enter phone numbers in Excel?
Format column A as Text before entering numbers. Include the country code and use digits only, without a plus sign, spaces, or punctuation.
Why won't a very long message open in WhatsApp?
The encoded message may make the URL longer than Excel, the browser, or the receiving app can handle. Try shortening or splitting the message, or use an authorized WhatsApp Business Platform integration.
Will rerunning the example send messages only to unfinished rows?
No. The example starts at row 2 every time and does not track completed sends. Remove or exclude completed rows before running it again.




