Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal Hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Private Const SW_SHOWNORMAL = 1
Private Sub Открыть_ссылку() ShellExecute 0&, "Open", "http://www.yandex.ru", _ vbNullString, vbNullString, SW_SHOWNORMAL End Sub
[/vba]
[vba]
Код
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal Hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Private Const SW_SHOWNORMAL = 1
Private Sub Открыть_ссылку() ShellExecute 0&, "Open", "http://www.yandex.ru", _ vbNullString, vbNullString, SW_SHOWNORMAL End Sub
Sub tt() a_ = ActiveCell.SpecialCells(xlLastCell).Offset(1).Address ActiveSheet.Hyperlinks.Add(Range(a_), "http://www.excelworld.ru/forum/10-6561-1").Follow Range(a_).Clear End Sub
[/vba]
Такой вот простенький вариант [vba]
Код
Sub tt() a_ = ActiveCell.SpecialCells(xlLastCell).Offset(1).Address ActiveSheet.Hyperlinks.Add(Range(a_), "http://www.excelworld.ru/forum/10-6561-1").Follow Range(a_).Clear End Sub