Add Telephone Hyperlink to cell

jeffmoseler

Well-known Member
Joined
Jul 16, 2004
Messages
540
I would like to add a Teams phone call link to a column of phone numbers. I know that using a HYPERLINK formula with tel: in front works, but I need to use VBA add that formula for the whole column.

Here are some examples:

Cell A1: (555) 555-5555
=HYPERLINK(CONCATENATE("TEL:", A1)) (shows tel: (555) 555-5555) If I click on the link it takes me to Teams and makes the call.

How do I apply the HYPERLINK to the whole column?

I have come up with this but I know it is wrong:

VBA Code:
Dim vPhoneNo As String

For Each cell In Sheet1.Range("N12:N500")
    If Not IsEmpty(cell) Then
        vPhoneNo = cell.Value
        vPhoneNo = "tel:" & vPhoneNo
        cell.Value = Hyperlinks.Add(vPhoneNo)
    End If
Next

What would you suggest?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
.
See if this works :

VBA Code:
Sub Test()
Dim cell As Range
Dim bIsEmpty As Boolean
Dim Hyperlinks
Dim vPhone As String

vPhone = Range("A1").Value
bIsEmpty = False
For Each cell In Range("N12:N500")
    If IsEmpty(cell) = True Then
        ActiveSheet.Hyperlinks.Add cell, "Tel :" & vPhone
     End If
Next cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top