+ Reply to Thread
Results 1 to 5 of 5

Address:= .hyperlinks(1).Address subscript out of range

  1. #1
    Registered User
    Join Date
    12-03-2015
    Location
    Ohio, US
    MS-Off Ver
    2013
    Posts
    22

    Address:= .hyperlinks(1).Address subscript out of range

    I'm getting a subscript out of range for the Address:= portion of the code below. Since I'm new to VBA and somebody else wote the original code (and have disappeared). I need to figure out what is going on.

    While I really have no idea how the initial rw variable assignment works (seems messy, but someone else wrote it), the variable rw has the correct value at the point the error is thrown. I have also used the Range("BX" & rw).value object successfully in assign statements both above and below the error. So I know that's right. From what I've read ".Hyperlinks(1).Address" also seems to be the correct way to refer to the first hyperlink in a specific cell. So I'm stumped.

    Can anyone tell me why the subscript is out of range?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Address:= .hyperlinks(1).Address subscript out of range

    May be this?

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    12-03-2015
    Location
    Ohio, US
    MS-Off Ver
    2013
    Posts
    22

    Re: Address:= .hyperlinks(1).Address subscript out of range

    That eliminated the error, but did not copy the hyperlink (only the cell value). I would think that ".Hyperlinks(1)." has to be part of the Address:= or SubAddress:= statement. Then again I'm a newb.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Address:= .hyperlinks(1).Address subscript out of range

    Please explain in words about what you are trying to do with complete description.

  5. #5
    Registered User
    Join Date
    12-03-2015
    Location
    Ohio, US
    MS-Off Ver
    2013
    Posts
    22

    Re: Address:= .hyperlinks(1).Address subscript out of range

    Since your variation gives no error, but not the result I'm looking for, I've tried to lay this out more completely below and shown my current version of the code (that throws subscript out of range errors).


    Essentially I have 2 sheets in the same workbook. The first is laid out like a form, allowing the user to review data in a nice format. The second is like a database, where every row corresponds to a unique record. I need to write a "save" macro from the form-type sheet that can handle either of 2 circumstances.
    1) the macro is saving a new record to a row of the target "database type" sheet
    2) the macro could be saving a data updated record to a same row of the target sheet that it was retrieved from in the first place.

    Ok, so I'm working on the part of the save macro that will copy a hyperlink (and preferably only the hyperlink, not colors/formats) and paste it into the database sheet.

    I have tried what seems like dozens of variations all either ending in a subscript error (when I use the .hyperlinks(1).address method) or not generating an error, but also not copying the hyperlink (just the text value of the cell).

    The hyperlink to be copied is in sheet TE_Form , in a named range "TE_Image" which is in cell C27

    The destination will either be sheet LogDB cell BX6 (when this is a new record being added to LogDB) -or- sheet LogDB cell BX? (where the ? is the row number of an existing record in the DB_Log).

    In the case when it is an existing record being copied to LogDB, I use the .Find method and a variable rw to identify which row within column BX that link should be pasted.


    Here is what I've got now (boiled down from a long macro):


    Please Login or Register  to view this content.
    And before I forget, I really appreciate the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run time error '1004': The address of this site is not valid. Check the address the addre
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2014, 06:59 AM
  2. [SOLVED] Use address of named range to find same address in another worksheet
    By dwsteyl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-08-2013, 04:56 PM
  3. Converting a complete, single column address into separate columns for ADDRESS, CITY, ST,
    By jeffrogerssn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2012, 10:34 AM
  4. Turn column of text email address into hyperlinks
    By bmblack in forum Excel General
    Replies: 2
    Last Post: 12-29-2008, 12:06 PM
  5. Extracting http:// address from text hyperlinks
    By Gdelrio3 in forum Excel General
    Replies: 2
    Last Post: 10-25-2007, 12:35 AM
  6. Hyperlinks:to an e-mail address
    By ajshap1 in forum Excel General
    Replies: 6
    Last Post: 04-11-2007, 02:31 AM
  7. [SOLVED] Help me Please!! Need hyperlinks to show actual email address!
    By dustin in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-13-2005, 05:06 PM

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