ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   to click on a cell and go to named local HTML file (https://www.excelbanter.com/excel-programming/342410-click-cell-go-named-local-html-file.html)

[email protected]

to click on a cell and go to named local HTML file
 
Hi There

Can anyone help me with the code required to display the local HTML
file named in the selected (clicked on) cell?

I do not want a button. I just want the user to be presented with the
HTML file that they are working on, after clicking on a cell.

Would really appreciate your help. I am using 2002.

Regards
Geoff


Jim Cone

to click on a cell and go to named local HTML file
 
Geoff,
Maybe this...
'------------
Sub ClickAndGo()
Dim strPath As String
Dim strName As String

strName = "readme.html"
strPath = "C:\Program Files\Zone Labs\ZoneAlarm\readme.html"
Range("B7").Value = "=Hyperlink(""" & strPath & """,""" & strName & """)"
End Sub
'------------

Jim Cone
San Francisco, USA



wrote in message
ups.com
Hi There
Can anyone help me with the code required to display the local HTML
file named in the selected (clicked on) cell?
I do not want a button. I just want the user to be presented with the
HTML file that they are working on, after clicking on a cell.
Would really appreciate your help. I am using 2002.
Regards
Geoff


[email protected]

to click on a cell and go to named local HTML file
 
Jim

I can't thank you enough for your assistance here, but.. I think that I
have not been very clear in my request, so I will try again.

I have developed a worksheet that builds the rows of a table in a web
page.
The idea is then for the user to double click on a specific and user
editable cell on the worksheet, to which a macro is attached, and then
bring up the web page for editing and renewing the rows in the table.

The path should not be neccessary because the target web page resides
in the same directory as the workbook.

There will be about 8 of these specific cells so a macro is required
for each one. Each macro needs to be "double click" because the user
needs to be able to edit the cell.

Hope that is a lot clearer.

Geoff


Jim Cone

to click on a cell and go to named local HTML file
 
Geoff,

Code similar to the following placed in the worksheet module
should get the job done for you...
'-------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address = "$B$7" Then
Workbooks.Open Filename:=ThisWorkbook.Path & "\readme.html"
Cancel = True
End If
End Sub
'--------------

Regards,
Jim Cone
San Francisco, USA


wrote in message
oups.com...
Jim
I can't thank you enough for your assistance here, but.. I think that I
have not been very clear in my request, so I will try again.
I have developed a worksheet that builds the rows of a table in a web
page.
The idea is then for the user to double click on a specific and user
editable cell on the worksheet, to which a macro is attached, and then
bring up the web page for editing and renewing the rows in the table.
The path should not be neccessary because the target web page resides
in the same directory as the workbook.
There will be about 8 of these specific cells so a macro is required
for each one. Each macro needs to be "double click" because the user
needs to be able to edit the cell.
Hope that is a lot clearer.
Geoff



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com