+ Reply to Thread
Results 1 to 10 of 10

Range.Hyperlinks.Count failing

  1. #1
    Banned User!
    Join Date
    01-17-2021
    Location
    Omaha, NE
    MS-Off Ver
    office 2016
    Posts
    211

    Range.Hyperlinks.Count failing

    my code not working and i think it is right. can someone check? i am looping 25 rows backwards stepping and 4 out of 25 cells are being missed or the code executing on those cells when it should not be. here is code
    Please Login or Register  to view this content.
    i also attached images for what i have to this post. i cant see my mistake. i dont think there is one. is there? my pics show code broken on row 16 and the first mistake it makes.
    Attached Images Attached Images

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,317

    Re: Range.Hyperlinks.Count failing

    Without knowing what it is you're trying to accomplish, it's difficult to determine the problem.


    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Banned User!
    Join Date
    01-17-2021
    Location
    Omaha, NE
    MS-Off Ver
    office 2016
    Posts
    211

    Re: Range.Hyperlinks.Count failing

    i do not know what desensitizing means. sorry. here is workbook. i describe issue perfectly though. is not tough.
    i am looping a range and inserting cells. that is all. simple. this is not for a business.

    there is one code routine in workbook i uploaded. i have 4 sheets for you. before code. after code. what i'd like to see. and all the data i
    have available for use and to run code on. as you see, code is making mistakes. funny thing is. if i run same code on different samples from data
    in the "all data" tab, it works fine! i think something is wrong with actual data. it is like excel thinks some are not links, but they all really are.
    code is doing nothing but apply conditional IF on cells based on hyperlink tests.

    what is wrong?
    Attached Files Attached Files

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,317

    Re: Range.Hyperlinks.Count failing

    Some of the links in the before worksheet have no url in the address section of the link, while all of the links in the all_data sheet have them (Edit: not all are there). If you hover your mouse over then cells, some will change to the pointing finger to click and on the others, the cursor does not change. If you right click and see an Edit Hyperlink' selection, it has a URL. If it only shows the plain 'Link' selection, it doesn't have a URL.

    Once you fix the links, try this simpler bit of code...
    Please Login or Register  to view this content.
    Last edited by dangelor; 03-12-2021 at 10:40 AM.

  5. #5
    Banned User!
    Join Date
    01-17-2021
    Location
    Omaha, NE
    MS-Off Ver
    office 2016
    Posts
    211

    Re: Range.Hyperlinks.Count failing

    question:

    so if 'currentregion' works, and your code is supposed to point to or select what i am currently looping
    Please Login or Register  to view this content.
    then why does article by microsoft not say that?

    https://docs.microsoft.com/en-us/off....currentregion

  6. #6
    Banned User!
    Join Date
    01-17-2021
    Location
    Omaha, NE
    MS-Off Ver
    office 2016
    Posts
    211

    Re: Range.Hyperlinks.Count failing

    and why do you think that those URL links are not being put into those cells? the addresses are getting into cells by me copy and paste from the firefox browser address bar when i look up the pages on youtube. is that doing it? because if some are there and some not, i am doing same thing for all. so that not make sense.

  7. #7
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,317

    Re: Range.Hyperlinks.Count failing

    Quote Originally Posted by omahaNative_1023 View Post
    question:

    so if 'currentregion' works, and your code is supposed to point to or select what i am currently looping
    Please Login or Register  to view this content.
    then why does article by microsoft not say that?

    https://docs.microsoft.com/en-us/off....currentregion
    The article just explains the currentregion property of a range object. That line of code assigns a specific range (using the currentregion property) to a variable.

    Here's a link to an excellent article on ranges. Click here.
    Last edited by dangelor; 03-13-2021 at 06:41 AM. Reason: Added link

  8. #8
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,317

    Re: Range.Hyperlinks.Count failing

    Quote Originally Posted by omahaNative_1023 View Post
    and why do you think that those URL links are not being put into those cells? the addresses are getting into cells by me copy and paste from the firefox browser address bar when i look up the pages on youtube. is that doing it? because if some are there and some not, i am doing same thing for all. so that not make sense.
    Sorry, I haven't a clue... might try asking in a new thread.

  9. #9
    Banned User!
    Join Date
    01-17-2021
    Location
    Omaha, NE
    MS-Off Ver
    office 2016
    Posts
    211

    Re: Range.Hyperlinks.Count failing

    thank you ,.......

  10. #10
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,317

    Re: Range.Hyperlinks.Count failing

    Glad to help when I can!

+ 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. Macro failing to copy range
    By Duncan Lithgow in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-06-2020, 07:28 AM
  2. [SOLVED] Count of Filtered Data Failing If Then Statement
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-21-2019, 12:18 PM
  3. [SOLVED] Range containing many hyperlinks is default blue font -fix to be black but keep hyperlinks
    By RedSummer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2015, 12:01 PM
  4. Where is this 'count responses' code failing?
    By henryBukowski in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2014, 07:11 AM
  5. failing hyperlinks
    By larscw in forum Excel General
    Replies: 1
    Last Post: 10-14-2009, 10:26 AM
  6. Hyperlinks failing to open
    By dmilosky in forum Excel General
    Replies: 0
    Last Post: 07-02-2009, 11:59 AM
  7. Excel 2007 : Hyperlinks failing
    By Rick_Stanich in forum Excel General
    Replies: 0
    Last Post: 10-24-2008, 10:42 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1