PC Review


Reply
Thread Tools Rate Thread

Change pattern for individual data points on chart

 
 
JimT
Guest
Posts: n/a
 
      9th Dec 2008
Using a standard column chart, I would like to change the pattern for a given
data point if it's reference cell contains the text "Fail".

The code I've got thus far will change the first point that Fails the first
time the macro is run. It won't change other points that Fail, and if I
change the pattern manually and run the code again, it will only select the
first data point that Fails, but not change the pattern.

Code follows:
Code:
Private Sub Stripe()

Dim objCht As ChartObject
Dim i As Integer
Dim rngCnt As Range
Dim rngCell As Range

With Sheets(1)
Set rngCnt = .Range(.Range("E2"), .Range("E65536").End(xlUp))

i = 1

For Each rngCell In rngCnt
If rngCell.Offset(, 1) = "Fail" Then
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Points(i).Select
Selection.Fill.Patterned Pattern:=msoPatternWideUpwardDiagonal
End If
i = i + 1
Next rngCell
End With
End Sub
Any hints/tips appreciated!
 
Reply With Quote
 
 
 
 
JimT
Guest
Posts: n/a
 
      9th Dec 2008

Okay, so I'm silly. Well actually my Citrix client is silly. The below code
DOES work as expected; just I had a hanging Excel instance that was munging
up the works.

Thanks, all. Now on to the next issue... *laughter*
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Gradient Fill Colors of Bar Chart data points PaulPW Microsoft Excel Programming 1 22nd May 2010 02:16 AM
XY Scatter Chart - Drag individual data points on graph Darril Microsoft Excel Charting 8 20th May 2009 03:02 PM
XY Scatter Chart - Drag individual data points on graph DOV Microsoft Excel Misc 1 1st May 2009 11:19 PM
add individual data points to a bar chart of averages =?Utf-8?B?bGVub3M=?= Microsoft Excel Charting 2 31st May 2007 08:55 AM
Editting individual data points on a chart programmatically =?Utf-8?B?QmxvY2tOaW5qYQ==?= Microsoft Access VBA Modules 0 27th Dec 2005 05:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:42 AM.