+ Reply to Thread
Results 1 to 8 of 8

vba hyperlink

  1. #1
    Registered User
    Join Date
    12-05-2006
    Posts
    81

    vba hyperlink

    Hello all,

    Is there a way to have a button to create a hyperlink to the currently selected cell, and not change the text in the cell? The hyperlink would be to the same folder but I would need to select different picture for different text. Any help would be great .

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    This assumes in the cell you have the name of the file to link to (ie - bird.jpg).
    Please Login or Register  to view this content.
    Also note, you must insert the folder the file is in (text in red).

  3. #3
    Registered User
    Join Date
    12-05-2006
    Posts
    81
    This work great but I may not know what the file name is. And can it be opened new excel sheet?
    Thanks



    Quote Originally Posted by Ikaabod
    This assumes in the cell you have the name of the file to link to (ie - bird.jpg).
    Please Login or Register  to view this content.
    Also note, you must insert the folder the file is in (text in red).

  4. #4
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    How do you want the macro to figure out the filename?
    An input box? Reference from a cell? Open the folder of the files and let the user select one? Choose the next file in the folder? etc etc...

    Basically, substitute "Activecell.Value" in Line 2 of the previous code with the code you want to use to determine the filename (ie - if the filename is in cell A1 use the following code: Range("A1").Value)

    Finally, if you could clarify the following quote please:
    And can it be opened new excel sheet?

  5. #5
    Registered User
    Join Date
    12-05-2006
    Posts
    81
    Open the files and select one. Yes it could open in a new sheet.
    Thanks


    Quote Originally Posted by Ikaabod
    How do you want the macro to figure out the filename?
    An input box? Reference from a cell? Open the folder of the files and let the user select one? Choose the next file in the folder? etc etc...

    Basically, substitute "Activecell.Value" in Line 2 of the previous code with the code you want to use to determine the filename (ie - if the filename is in cell A1 use the following code: Range("A1").Value)

    Finally, if you could clarify the following quote please:

  6. #6
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    The following code will put the filename chosen by the user into the activecell's hyperlink (keeping the cells value the same). When the hyperlink is clicked the file will be opened by the default program for that file type (ie - .xls, .jpg, .doc)
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-05-2006
    Posts
    81
    Ikaabod,

    Thanks this is exactly what I was looking for it works great. I owe you .

  8. #8
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    Glad to help. Thanks for the feedback. Best wishes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1