Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jun 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating a hyperlink with a macro (97/2000)

    I have a macro that creates individual reports/files out of a large data set (it filters on a person, gets that person's data into a report "template" and saves it with a file name for the person). One item on the report is a link to a web page. Since the position of that link varies depending on how much data each person has, it has to be copied and pasted onto the report at the end of the data. But the copied link isn't a link. When I manually copy and paste a cell that has an active working link, the copied cell/link works just fine. When I record a macro with those exact key strokes, it works - i.e. the link is active. But when I run the macro, the copied link looks fine-like a link, but it isn't "active" - you can't click on it. Suggestions? I can do a work-around by putting it somewhere else on the report template, but I'd like to know why this doesn't work.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating a hyperlink with a macro (97/2000)

    The attached workbook has a hyperlink in Sheet1!A1.
    When I click the big button, the hyperlink is copied to Sheet2!C5 and the copy works for me.
    What happens if you open the workbook and click the button?
    Attached Files Attached Files

  3. #3
    New Lounger
    Join Date
    Jun 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a hyperlink with a macro (97/2000)

    Interesting - yours worked. Below is my code that didn't work. I changed it to the syntax you used and it worked ??!!
    tr = "pos1"
    Range("plink").Copy
    Sheets("Report").Select
    Range(tr).Select
    ActiveSheet.Paste
    New version that worked:
    tr = "pos1"
    Range("plink").Copy Sheets("Report").Range(tr)
    Thanks!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating a hyperlink with a macro (97/2000)

    I'm glad it works. I can't explain why your code didn't...

Posting Permissions

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