+ 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

X vBulletin 4.1.8 Debug Information

  • Page Generation 0.06600 seconds
  • Memory Usage 9,030KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (3)bbcode_code
  • (1)footer
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (8)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (4)navbar_noticebit
  • (6)option
  • (1)postbit_attachment
  • (8)postbit_legacy
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (4)showthread_bookmarksite
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper
  • (1)vbseo_linkbackmenu_entry 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (39):
  • ./vbseo.php
  • ./env.php
  • ./vbseo/includes/functions_vbseo.php
  • ./vbseo/includes/functions_vbseo_pre.php
  • ./vbseo/includes/functions_vbseo_url.php
  • ./vbseo/includes/functions_vbseo_createurl.php
  • ./vbseo/includes/functions_vbseo_db.php
  • ./vbseo/includes/functions_vbseo_vb.php
  • ./vbseo/includes/functions_vbseo_seo.php
  • ./vbseo/includes/functions_vbseo_misc.php
  • ./vbseo/includes/functions_vbseo_crr.php
  • ./vbseo/includes/functions_vbseo_cache.php
  • ./vbseo/includes/functions_vbseo_hook.php
  • ./vbseo/includes/functions_vbseo_startup.php
  • ./includes/config.php
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/functions.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/functions_cforum.php
  • ./includes/functions_facebook.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php
  • ./includes/functions_notice.php 

Hooks Called (47):
  • init_startup
  • friendlyurl_resolve_class
  • database_pre_fetch_array
  • database_post_fetch_array
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • fetch_musername
  • cache_templates
  • template_register_var
  • parse_templates
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • reputation_image
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • showthread_bookmarkbit
  • navbits
  • navbits_complete
  • showthread_complete


Search Engine Friendly URLs by vBSEO 3.6.0 RC 1