|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Excel-VB hyperlink
Right Im new to VB and I am trying to add a button on my excel spread sheet that with open the defult browser to a fixed page on the web.
Trouble is I havent got a clue how the code sould read. Can anyone help plz? Mark |
|
#2
|
||||
|
||||
|
hyperlinks
Hello Allmud,
Create a hyperlink to an existing file or Web page Right-click the text or graphic you want to represent the hyperlink, and then click Hyperlink on the shortcut menu. Under Link to on the left side of the dialog box, click Existing File or Web page. Do one of the following: To select a file from the current folder, click Current Folder and then click the file you want to link to. To select the Web page from a list of browsed pages, click Browsed Pages and then click the Web page you want to link to. To select a file from a list of files you have recently used, click Recent Files and then click the file you want to link to. If you know the name and location of the file or Web page you want to link to, you can type that information in the Address box. To select the Web page by opening your browser and searching for the page, click Browse the Web , open the Web page you want to link to, and then switch back to Microsoft_Excel without closing your browser. To assign a tip to be displayed when you rest the pointer on the hyperlink, click ScreenTip and then type the text you want in the ScreenTip text box. Click OK. Create a hyperlink to a specific location on a Web page To create a hyperlink to a specific location on a Web page, make sure the Web page has a bookmark at that location. In Microsoft Excel, right-click the text or graphic you want to represent the hyperlink, and then click Hyperlink on the shortcut menu. Under Link to on the left side of the dialog box, click Existing file or Web page. Do one of the following: To select a Web page from the current folder, click Current Folder and then click the Web page you want to link to. To select the Web page from a list of browsed pages, click Browsed Pages and then click the Web page you want to link to. To select a Web page from a list of files you have recently used, click Recent Files and then click the Web page you want to link to. If you know the name and location of the Web page you want to link to, you can type that information in the Address box. To select the Web page by opening your browser and searching for the page, click Browse the Web , open the Web page you want to link to, and then switch back to Excel without closing your browser. Click Bookmark, and then double-click the bookmark you want. To assign a tip to be displayed when you rest the pointer on the hyperlink, click ScreenTip, type the text you want in the ScreenTip text box, and then click OK. I found this in the Excel help files - all I typed was 'Hyperlink' and it gave me a lot of info (more than I've posted). Help files (esp., on MS products) are generally the best place to start if you're looking for info. It's also a good place to pick-up the right kind of terms/lingo so you can refine your searches. Hope this helps, nao
__________________
NAO'S DISCLAIMER YOU MAY FREELY APPLY, ENTIRELY AT YOUR OWN RISK, ANY ADVICE, IDEAS, METHODOLOGIES OR CODE CONTAINED IN THIS POSTING. |
|
#3
|
|||
|
|||
|
Thanx for the info and the time to repley, but I can do a hyperlink in excel. What Im trying to do is make a button in the control panel (which is no problem) and when you click that button, and it depresses, it opens the defult brouser to a web page.
So I need to know what VB code to put in the buttons propertys to hyperlink. Ive enclosed a pic of what I meen. Ive got round it a bit by makeing a link in a cell then linking button to that. It works but there must be another, more direct way Mark |
|
#4
|
|||
|
|||
|
right heres that pic of what i meen
|
|
#5
|
|||
|
|||
|
Try something like this...
Code:
Sub toweb()
ActiveWorkbook.FollowHyperlink Address:= _
"http://www.google.com/", NewWindow:= _
False, AddHistory:=True
Application.WindowState = xlNormal
End Sub
That is your macro in a regular module, then the code in your command button_click should look like this... Code:
Private Sub CommandButton1_Click() toweb End Sub Just substitute the google address for your webpage. Chuck ![]() |
|
#6
|
|||
|
|||
|
Thanks for that, worked a treat.
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Excel-VB hyperlink |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|