Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Microsoft Excel 2003 wherein i have a cell which has a comment. The comment has text as well as URL. Is it possible to create a hyperlink (URL) in comment box where user can click and it automatically opens the URL ?

Thanks,

share|improve this question

3 Answers 3

up vote 1 down vote accepted

James, If it were me, I would keep this as simple as possible. I'd just have a brightly colored box somewhere out of the way with these guidelines and the link.

If you're interested though, here are steps you can follow to insert the VBA to create a pop-up rectangle text box next to the currently selected cell with whatever text you want it to say:

  1. Open your workbook in Excel.
  2. Select Insert menu > Picture > Autoshapes. Select a rectangle.
  3. Place one rectangle anywhere on the sheet you want to work with.
  4. Edit the text and make it say whatever you like, including a hyperlink.
  5. Select the frame of that rectangle (not the text inside) and then find the name box in the upper-left corner of Excel. It will probably be named something like "Rectange11" now. Change the name to, "Guideshape" (since that's what the code looks for). 6.Right-click the sheet's tab at the bottom of Excel and select View Code.
  6. Paste this code into the big empty text area on the right side of the screen:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        Application.EnableEvents = False
    
        On Error Resume Next
    
        Shapes("GuideShape").Visible = msoFalse
    
        If Not Intersect(Target, Range("C5:C8")) Is Nothing Then
    
            With Me.Shapes("Guideshape")
                 .Visible = msoTrue
                 .Top = Target.Top
                 .Left = Target.Left + 150
            End With
        End If
    
        On Error GoTo 0
    
        Application.EnableEvents = True
    
    End Sub
    
  7. Look for the line that has ("C5:C8") and change that include your range of editable cells where this message should pop-up. Keep the parentheses and double-quotes!

  8. Close the VB editor and return to Excel.

Now whenever you click in a cell in the range you entered into the code, the rectangle you created should appear to the right of that cell. Play with the TOP and LEFT numbers in the code to change that position.

Good luck!

share|improve this answer

No, you can't create a hyperlink in a comment. You can only insert the URL text.

Hyperlinks is a property of a Range or Worksheet (which comments aren't). There's also a Hyperlink property for a Shape, but that wouldn't apply here (though there might be some really tricky way you could have an image cover the commment and provide the hyperlink).

share|improve this answer
    
Actually this worksheet is a assessment sheet where user is expected to fill data based on certain guidelines. So user would get the guidelines when mouse is over this cell and accordingly he can fill data for this cell. (Last line in this guideline has a reference to the URL to view more information - which would be nice to have clickable URL). And above behavior is true for all cells in that column. I am not able to think of any other way to design this. Any suggestions ? –  James Feb 2 '10 at 19:17
    
@James, You might add a small column next to that one with hyperlinks in them, maybe a label of 'more?', OR if you're really into programming you can use VBA, and trigger off of one of the events, so that when the user clicks in the cell, a small graphic or textbox pops up with the information, and that can hold a hyperlink. –  Lance Roberts Feb 3 '10 at 22:19
    
I am not familiar with event triggering. I will try to look into that option as well. Thanks Lance ! I see an opportunity for Microsoft to add URL option in the comment :) –  James Feb 5 '10 at 9:07

I don't think Excel supports hyperlinks in comments. VBA will likely not help you there.

Could you not put URLs on a column next to your cells instead?

If you're strongly determined to have some sort of tooltip link, you could probably program a tooltip behavior from scratch in VBA (create little yellow form, place it next to cell, hide it when user clicks on another cell, etc..) but that would work separately from the real comments, and probably a few things wouldn't integrate very well, and probably not a very good idea anyway.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.