Good day,
Please I need your help to make the CommandButton1 to Change External Links from range D3 to F11 and the CommandButton2 from D12 to F14
Please I need your help to make the CommandButton1 to Change External Links from range D3 to F11 and the CommandButton2 from D12 to F14
VBA Code:
[/B]
Private Sub CommandButton1_Click()
Dim sLinkNew As String
Dim aLinks As Variant, vLink As Variant
MsgBox "Please choose the new file.", vbQuestion, "Atty Data File"
Application.DisplayAlerts = False
With Application.FileDialog(msoFileDialogFilePicker)
If .Show <> -1 Then MsgBox "No file selected! Exiting script.": End
sLinkNew = .SelectedItems(1)
Application.DisplayAlerts = True
End With
aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
For Each vLink In aLinks
ActiveWorkbook.ChangeLink Name:=vLink, NewName:=sLinkNew, Type:=xlExcelLinks
Next: End If
End Sub
[B]