LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Displaying Web Page

Hi Jim,

Jim Zeeb wrote:
I want to display a web page using info from a cell when that cell is
double clicked.

For example, I have a cell with a stock symbol in it ( i.e. MSFT)
When I double-click the cell, I want to start IE with the URL:
http://finance.yahoo.com/q?s=MSFT


Something like this may work for you:

Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)
Dim sTicker As String
Dim objIE As Object

If Target.Cells.Count = 1 Then
sTicker = CStr(Target.Value)
If Len(sTicker) = 4 And Not IsNumeric(sTicker) Then
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Navigate "http://finance.yahoo.com/q?s=" _
& CStr(sTicker)
.Visible = True
End With
Set objIE = Nothing
End If
End If
End Sub

This code should be placed in the worksheet module (right-click sheet tab
and select View Code).

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

 
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
Saving Excel 2010 files as web page or single file web page Joe Artis Excel Discussion (Misc queries) 3 April 29th 23 03:44 AM
Format page number in excel footer to start at a specific page # straitctrydncr Excel Discussion (Misc queries) 4 April 28th 23 07:45 PM
Excel saved as Htm displaying tabs on web page Katie Setting up and Configuration of Excel 2 October 27th 09 02:40 PM
Displaying Page Titles For Urls דוד Excel Discussion (Misc queries) 2 April 16th 07 12:32 PM
Displaying Web Page Chip Pearson Excel Programming 0 July 15th 04 09:21 PM


All times are GMT +1. The time now is 08:17 AM.

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

About Us

"It's about Microsoft Excel"