+ Reply to Thread
Results 1 to 8 of 8

invert if negative chart issue

  1. #1
    Registered User
    Join Date
    06-29-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    37

    invert if negative chart issue

    Hi I am using these steps
    http://www.andypope.info/charts/Invertneg.htm
    to fill color if negative for my bar graph. But it works only when sheet is active. When when I close that excel workbook and open again. color of bar chart change automatically from red and green to blue and white. I could not figure out why color change automatically whenever I open my sheet again. I was trying to call following sub when sheet become active but that give error 1004 in line 2. I was trying to assign macro to chart. But that works only if I select chart. Is there any solution
    Please Login or Register  to view this content.
    http://www.mrexcel.com/forum/showthr...63#post2392363
    Last edited by MeenuSaini; 07-29-2010 at 08:46 AM.

  2. #2
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: invert if negative chart issue

    Hi there!

    Let us assume, that the worksheet you are using is Sheet 1, and the name of the chart is Chart 1. So I will use the following code to ensure that I dont have to select the chart/series/sheet.

    Please Login or Register  to view this content.
    Thanks,
    Vikas

  3. #3
    Registered User
    Join Date
    06-29-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: invert if negative chart issue

    That is working but for excel 2003. But when I try to open in excel 2007. There are entirely different colors. red become green. green become white. Thanks

  4. #4
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: invert if negative chart issue

    This is because the Excel 2007 works on theme colors and not on the color indexes like in 2003. Do you want to say that the color is being applied correctly in 2003 but not in 2007, or you want to say that when you open the spreadsheet in 2007 after applying color code, the colors are messed up? In either case, please give us a sample spreadsheet to verify.

    Thanks,
    Vikas

  5. #5
    Registered User
    Join Date
    06-29-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: invert if negative chart issue

    Attached is sheet that works perfect in excel 2003. But I need same color pettren when opened in Excel 2007. bar with -ve value Green and bar with +ve value red
    Thanks
    Attached Files Attached Files

  6. #6
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: invert if negative chart issue

    The following code gave me what you are actually looking for in 2007

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-29-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: invert if negative chart issue

    Thanks ...Sorry I sshould mention this before...
    I have a workbook that i need to upload online, so that people from different businesses can use this. I am using 2003 excel. But other people can have excel 2007. So I need code that work for both excel 2003 as well as 2007. Your code is working fine separately.
    Is there any way same code work for excel 2003 as well as excel 2007.
    I have still more problem to tackle people having Mac computer can not use my spreadsheets.
    Thanks

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: invert if negative chart issue

    If your mac users have office 2008, then you are out of luck.
    Remember what the dormouse said
    Feed your head

+ 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