+ Reply to Thread
Results 1 to 6 of 6

Conditional formating of tab colours not working as expected

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    5

    Conditional formating of tab colours not working as expected

    I want the tab color to change from red to green when the user a) completes a cell content on a sheet that results in its referenced cell changing from 0 to 1 then b) returns to the main tab called "VAT101".
    It all works except that the change only occurs when I click on the "Bank detail" tab instead of when I click on the "VAT101" tab. If I interchange the word "Company" with "Bank detail" in the code, the behaviour remains exactly the same. i.e it the colors still only change when I click on the "Bank detail" tab. Here is the code

    Please Login or Register  to view this content.
    Last edited by derekps98; 01-02-2013 at 02:35 AM. Reason: Didn't follow the rules

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Conditional formating of tab colours not working as expected

    Hello derekps98,

    Welcome to the Forum.
    You may want to have another read of the Forum Rules as it seems you overlooked the rule about code tags.
    Anytime VBA code is posted you are required to use code tags.

    Before getting help with your code, you need to edit your post to add the missing code tags. Simply highlight all of the VBA code then click on the button with the # symbol on it.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formating of tab colours not working as expected

    Hello derekps98,

    Welcome to the Forum.

    As Palmetto says:

    Before getting help with your code, you need to edit your post to add the missing code tags. Simply highlight all of the VBA code then click on the button with the # symbol on it.
    Unless you do that, you will most likely not receive any help.

    Happy New Year guys!
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Registered User
    Join Date
    12-31-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional formating of tab colours not working as expected

    I sorted it myself. I made a copy then deleted all of the code. Then I clicked on the VAT101 sheet in VBAProject and pasted the code to that worksheet. Now the color changes take effect when that particular sheet is activated.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formating of tab colours not working as expected

    Hello derekps98,

    Delete all your Code and try it instead of any Sheet, in ThisWorkBook.

    Please Login or Register  to view this content.
    Last edited by Winon; 01-02-2013 at 03:14 AM. Reason: Wrong Sheet Names

  6. #6
    Registered User
    Join Date
    12-31-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional formating of tab colours not working as expected

    Thanks Winon,
    As you see I solved it myself. I have a lot to learn - even how to ask a question properly!

+ 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