+ Reply to Thread
Results 1 to 4 of 4

Macro to add hyperlinks sometimes changes cell format as well

  1. #1
    Registered User
    Join Date
    09-29-2010
    Location
    Whitstable, Kent, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Unhappy Macro to add hyperlinks sometimes changes cell format as well

    I have used a macro to read a list of rows (a contents tab on a workbook with many tabs) and add a hyperlink to each cell that points to cell A1 in the tabs with the same name. On most workbooks with this contents page it works fine, but occasionally all the fonts are changed to plain, blue and underlined, where they were bold and had different colours before.

    Is there a default parameter that's not included that might be set in certain versions of the workbook and not others? Here's the macro. Can anyone see what's wrong?



    Please Login or Register  to view this content.
    Last edited by pike; 09-29-2010 at 06:07 AM. Reason: add code tags for newbie MP warning

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Macro to add hyperlinks sometimes changes cell format as well

    Hi Quorthon,
    welcome to the forum,

    blue and underlined text in indicates that it is a hyperlink and is the standard font
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    09-29-2010
    Location
    Whitstable, Kent, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro to add hyperlinks sometimes changes cell format as well

    Quote Originally Posted by pike View Post
    Hi Quorthon,
    welcome to the forum,

    blue and underlined text in indicates that it is a hyperlink and is the standard font

    Thanks, but it's replacing the original formatting (which was bold and with various colors). I wouldn't mind this if it always happened but fortunately for most workbooks it doesn't i.e. they keep their colors and bold fonts.

    e.g. most of the files I try it on look like this before AND after the macro runs

    Contents
    tab1
    tab2
    tab3


    which is much easier for me to follow than
    Contents
    tab1
    tab2
    tab3


    As there are 50 tabs, when they are all blue, small and underlined, they do blur together a bit.

    I'm wondering if there's a document property in the file that's causing this, rather than a fault in the macro - although missing an oprtional parameter might be what's up.

    still puzzled. . .

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Macro to add hyperlinks sometimes changes cell format as well

    Hi Quorthon
    can you attach workbook?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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