Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Need Macro To Open URL Link

In Excel I have www.ebay.com in cell K16.

Just below this cell I have a button (Macro) that when clicked, I want it to
open the Website.

Can someone show me how to activate the URL ?

Thanks In Advance.

Matt@Launchnet

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1

  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: Need Macro To Open URL Link

Sure, I can help you with that!

Here are the steps to create a macro that will open the URL in cell K16 when you click the button:
  1. First, make sure the Developer tab is visible in Excel. If it's not, go to File Options Customize Ribbon and check the box next to Developer in the right-hand column.
  2. Click on the Developer tab and then click on the Visual Basic button to open the Visual Basic Editor.
  3. In the Visual Basic Editor, click on Insert Module to create a new module.
  4. In the module, paste the following code:

    Formula:
    Sub OpenURL()
        
    Dim myURL As String
        myURL 
    Range("K16").Value
        ActiveWorkbook
    .FollowHyperlink myURL
    End Sub 
  5. Save the macro and close the Visual Basic Editor.
  6. Go back to your Excel worksheet and right-click on the button you created. Click on Assign Macro.
  7. In the Assign Macro dialog box, select the OpenURL macro and click OK.

Now, when you click the button, the OpenURL macro will run and open the URL in cell K16 in your default web browser.
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Need Macro To Open URL Link

Copy this into a cell and click on it
http://www.ebay.com/


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Launchnet" <u20911@uwe wrote in message news:7780097f3d959@uwe...
In Excel I have
www.ebay.com in cell K16.

Just below this cell I have a button (Macro) that when clicked, I want it
to
open the Website.

Can someone show me how to activate the URL ?

Thanks In Advance.

Matt@Launchnet

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy
that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
No Name
 
Posts: n/a
Default Need Macro To Open URL Link

The FollowHyperlink is nice and compact.

ActiveWorkbook.FollowHyperlink Address:="http://www.ebay.com",
NewWindow:=True

Add the "http://" part to your website string either in the macro or in the
cell. Excel complains without it.


"Launchnet" <u20911@uwe wrote in message news:7780097f3d959@uwe...
In Excel I have www.ebay.com in cell K16.

Just below this cell I have a button (Macro) that when clicked, I want it
to
open the Website.

Can someone show me how to activate the URL ?

Thanks In Advance.

Matt@Launchnet

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy
that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Need Macro To Open URL Link

Thanks . . .
The website name in the cell is changed from time to time so I need something
like the following:

ActiveWorkbook.FollowHyperlink Address:="http://(ActiveCell.Value), NewWindow:
=True"

I tried this, but since my programming ability is so week I don't know the
syntax.
Can you help with this?

Thanks
Matt@Launchnet

- wrote:
The FollowHyperlink is nice and compact.

ActiveWorkbook.FollowHyperlink Address:="http://www.ebay.com",
NewWindow:=True

Add the "http://" part to your website string either in the macro or in the
cell. Excel complains without it.

In Excel I have www.ebay.com in cell K16.

[quoted text clipped - 7 lines]

Matt@Launchnet


--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via http://www.officekb.com



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Need Macro To Open URL Link

Sub gotourlvariable()
ActiveWorkbook.FollowHyperlink Address:="http://" & ActiveCell.Value
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Launchnet via OfficeKB.com" <u20911@uwe wrote in message
news:779300ca6b421@uwe...
Thanks . . .
The website name in the cell is changed from time to time so I need
something
like the following:

ActiveWorkbook.FollowHyperlink Address:="http://(ActiveCell.Value),
NewWindow:
=True"

I tried this, but since my programming ability is so week I don't know the
syntax.
Can you help with this?

Thanks
Matt@Launchnet

- wrote:
The FollowHyperlink is nice and compact.

ActiveWorkbook.FollowHyperlink Address:="http://www.ebay.com",
NewWindow:=True

Add the "http://" part to your website string either in the macro or in
the
cell. Excel complains without it.

In Excel I have
www.ebay.com in cell K16.

[quoted text clipped - 7 lines]

Matt@Launchnet


--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy
that
you read my story. God Bless for everyones help.

Message posted via http://www.officekb.com


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
No Name
 
Posts: n/a
Default Need Macro To Open URL Link

Dim sURL As String
sURL = "http://" & ActiveCell.Value
ActiveWorkbook.FollowHyperlink Address:=sURL, _
NewWindow:=True


"Launchnet via OfficeKB.com" <u20911@uwe wrote in message
news:779300ca6b421@uwe...
Thanks . . .
The website name in the cell is changed from time to time so I need
something
like the following:

ActiveWorkbook.FollowHyperlink Address:="http://(ActiveCell.Value),
NewWindow:
=True"

I tried this, but since my programming ability is so week I don't know the
syntax.
Can you help with this?

Thanks
Matt@Launchnet

- wrote:
The FollowHyperlink is nice and compact.

ActiveWorkbook.FollowHyperlink Address:="http://www.ebay.com",
NewWindow:=True

Add the "http://" part to your website string either in the macro or in
the
cell. Excel complains without it.

In Excel I have www.ebay.com in cell K16.

[quoted text clipped - 7 lines]

Matt@Launchnet


--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy
that
you read my story. God Bless for everyones help.

Message posted via http://www.officekb.com



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Need Macro To Open URL Link

Thanks to Don & NO NAME
Both work. I used a little of both and it also now checks to see if
activecell is blank and if so gives a message.

Anain, thanks for the help. I really appreciate it.

Matt@Launchnet

- wrote:
Dim sURL As String
sURL = "http://" & ActiveCell.Value
ActiveWorkbook.FollowHyperlink Address:=sURL, _
NewWindow:=True

Thanks . . .
The website name in the cell is changed from time to time so I need

[quoted text clipped - 26 lines]

Matt@Launchnet


--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via http://www.officekb.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i link a file and open up in a new page? pinkypig Excel Discussion (Misc queries) 0 October 19th 06 10:21 PM
need to link without having source workbook open adbowe Excel Worksheet Functions 1 August 29th 06 06:22 PM
Need VB code for workbook open to open a link Daniel Baker Excel Discussion (Misc queries) 2 August 18th 06 01:30 AM
how do i open excel as an xls document from a web link instead of. Yep Excel Discussion (Misc queries) 1 June 29th 06 08:39 PM
How do I get my personal macro worksheet to open whenever I open . Claudia_R Excel Discussion (Misc queries) 3 December 9th 04 11:59 PM


All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"