+ Reply to Thread
Results 1 to 3 of 3

Hyperlink looping through a range

  1. #1
    Registered User
    Join Date
    04-01-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    14

    Hyperlink looping through a range

    Hi,
    Summary of my issue

    - each workbook contains 100 worksheets, each one a project

    - the project start dates move frequently meaning an update is necessary

    - i'm trying to loop through the range, follow each hyperlink to the different worksheets and update the start date to the value in row 4 which is always cell A12 on the project worksheet


    Problem

    - when i run the code here, it only updates the active sheet [A12]

    example, P-Two represents the tab called 'Project2' and i would like to get '01/04/13' into cell A12 on that tab


    any help would be greatly appreciated and am sure there will be a 'doh' moment for me if somebody is kind enough to help.loop through range with hyperlink.xlsm

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,221

    Re: Hyperlink looping through a range

    Your code has a few errors in it, even before you reach the hyperlink part.

    For example, Cell isn't defined when this code is executed so it causes an error.

    Please Login or Register  to view this content.
    You won't see that error though as you have On Error Resume Next, the code will be skipped and StrMth will stay at it's default value of 0.

    What is Cell supposed to refer to?

    The next error you won't see is here.
    Please Login or Register  to view this content.
    VBA will be looking for a named range called 'rng' when there isn't one.

    That will also cause a problem here as Cell is Nothing.
    Please Login or Register  to view this content.
    [/code]

    The only line of code that won't error is this one, but all it will do is put 0 in A2 on the active sheet.
    Please Login or Register  to view this content.
    This code will run without error and it seems to work to some extent, but I'm not sure it does everything you want it to.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    04-01-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Hyperlink looping through a range

    That's absolutely perfect thanks. The rng was a hangover from another piece of code but not naming the cell variable was terrible on my part!
    Many thanks for taking time to reply, its exactly what i need as a already have the code to update the rest.

+ 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. VBA Looping Input Range and Output Range
    By Whitley in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2013, 12:04 PM
  2. Error handling with hyperlink looping
    By barksmith in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-22-2009, 12:32 PM
  3. Looping through rows in range AND comparing range cells
    By Damask in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-16-2006, 10:30 PM
  4. Determine if range has NO Blank Cells without looping through each cell in range
    By Excelenator in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-04-2006, 01:35 AM
  5. [SOLVED] Looping in a range
    By Robert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2006, 01:15 AM

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