+ Reply to Thread
Results 1 to 3 of 3

Changing font.colorindex on non active sheet

  1. #1
    Registered User
    Join Date
    04-22-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    59

    Changing font.colorindex on non active sheet

    I am bumping up against a problem with changing colorindex of a bunch of declared ranges. All works fines when the sheet containing these cells is the one active, when its not I get 1004 Unable to set the Colorindex property of the Font Class. I’m still learning but was wondering if it has anything to do with the range variables not being Global (or is that Public?)

    At first I thought I may also have hidden certain rows in the Union ranges and was trying to change the colorindex whilst hidden. I don’t think it is as I set the sheet to all unhidden at the start of the routine. As an aside is it actually a problem attempting to change formatting on hidden rows?

    As ever I am grateful for any direction/thoughts of the forum

    Please Login or Register  to view this content.
    Last edited by coasterman; 02-10-2012 at 06:51 PM.

  2. #2
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Changing font.colorindex on non active sheet

    Whenever you refer to simply Range("blah") it refers to the activesheet because you have not specified another one. If inside a With...End With block, you should use .Range("blah") because the . indicates that the range is a property of the object specified in the With statement. So, for example:
    Please Login or Register  to view this content.
    should be
    Please Login or Register  to view this content.
    Good luck.

  3. #3
    Registered User
    Join Date
    04-22-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    59

    Re: Changing font.colorindex on non active sheet

    I see now. the Range with or without the period was something that I had seen often but had not appreciated its significance.

    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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