Sunday, September 18, 2016

Troubleshooting:Changing graph colours by case for a second series

Changing graph colours by case for a second series

Hi I have a macro that changes the graph segment colours, depenent on their case;
Sub UpdateColors()
 
    Dim cho As ChartObject
    Dim ser As Series
    Dim i As Long
    Dim c As Long
    For Each cho In ActiveSheet.ChartObjects
        Set ser = cho.Chart.SeriesCollection(1)
        For i = 1 To ser.Points.Count
            Select Case ser.XValues(i)
                Case "Apple"
                    c = RGB(64, 64, 64)
                Case "Pear"
                    c = RGB(248, 40, 70)
                Case "Orange"
                    c = RGB(150, 64, 64)
               
            End Select
            ser.Points(i).Format.Fill.ForeColor.RGB = c
        Next i
    Next cho
   
        Application.ScreenUpdating = True
End Sub

I have a chart that has a second series but the macro above only changes the first series, I have found out though that if I change the series order manually and re-run the code it then re-colours the second series.
Can this code be amended so that it applies to both series, or can I have the macro run, then change the series order then run again?

Thanks
Newbeetle

Keys to the Problem Changing graph colours by case for a second series

Download Error Fixer for Free Now

Try this version:
 
Sub UpdateColors()
    Dim cho As ChartObject
    Dim ser As Series
    Dim i As Long
    Dim c As Long
    Application.ScreenUpdating = False
    For Each cho In ActiveSheet.ChartObjects
        For Each ser In cho.Chart.SeriesCollection
            For i = 1 To ser.Points.Count
                Select Case ser.XValues(i)
                    Case "Apple"
                        c = RGB(64, 64, 64)
                    Case "Pear"
                        c = RGB(248, 40, 70)
                    Case "Orange"
                        c = RGB(150, 64, 64)
                End Select
                ser.Points(i).Format.Fill.ForeColor.RGB = c
            Next i
        Next ser
    Next cho
    Application.ScreenUpdating = True
End Sub

Open Action Center by clicking the Start button Picture of the Start button, clicking Control Panel, and then, under System and Security, clicking Review your computer's status.

Make sure your computer has at least the minimum amount of random access memory (RAM) required to run the program that is displaying the error. Look for the program requirements online or in the packaging information.

Another Safe way to Fix the Problem: Changing graph colours by case for a second series:

How to Fix Changing graph colours by case for a second series with SmartPCFixer?

1. Click the button to download SmartPCFixer . Install it on your computer.  Open it, and it will scan your computer. The junk files will be shown in the scan result.

2. After the scan is done, you can see the errors and problems need to be repaired. Click Fix All.

3. The Fixing part is finished, the speed of your computer will be much higher than before and the errors have been fixed.


Related: How Can You Update & Download Toshiba Satellite 5105-S501 Intel PRO 10/100 Driver v.8.0.43.0,How to Update & Download Toshiba Satellite C655D-S5139 BookPlace v.2.2.7530 driver,Method to Update & Download Toshiba Satellite L655-S5073 Realtek Wireless LAN Driver v.2.00.0011,Method to Update & Download Toshiba Satellite L840-ST2N01 Sleep Utility v.1.4.0022.000104 driver,Best Way to Update & Download Toshiba Satellite Pro S300-EZ2502 Extended Tiles for Windows Mobility Center v.1.01 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.8.17.12.6686,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.11.6.0.1030,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.9.3.0.1019,Method to Update & Download ASUS K41VD Intel INF Update Driver v.9.1.1.1015,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver,Can't Download PP Templates Automatically To Windows 7 W/IE 8,Can't Change Drive Letter - Vista,Can't Change Homegroup Sharing Permission,Can't Connect XP Shared Printer To Win7 Except As A Local Printer.__,Can You Connect The LAN Adapter For Wii On Your Windows 7 Laptop?
Read More: Troubleshooting:Change the location of the App Store Error,How to Fix - capture data from fields in Word Template?,Cascading styles question [Anwsered],How Can I Fix - Changing width of chart with autofiter?,[Anwsered] checking latest date within a list,Can't access c drive to open programs.,Can you use just one hard drive to store a backup disk image and restore for multiple computers?,can not install Mcafee due to Java script error,,Can Word's track changes comments print in the outside border?,cannot install old software program because computer missing indeo codec driver

No comments:

Post a Comment