LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default How to format Series with VBA?

I need to format about 30 series on a number of charts. Sometimes I have
100 charts to loop through, which means 3000 series.

I'm wondering if there's a way to specify a group of series to format at
once rather than looping through each one individually. For example, is
there some way to say:

objChart.Series(3, 30).ColorIndex = 3

so that formatting is applied to series 3 through 30 at once?

Here's what I'm doing now, which seems rather slow:

Do While k < (objChart.SeriesCollection.Count)
k = k + 1
If k 2 Then
objChart.SeriesCollection(k).Border.ColorIndex = st
objChart.SeriesCollection(k).Border.Weight = xlThin
objChart.SeriesCollection(k).Border.LineStyle = xlNone
objChart.SeriesCollection(k).MarkerBackgroundColor Index = xlNone
objChart.SeriesCollection(k).MarkerForegroundColor Index = st
objChart.SeriesCollection(k).MarkerStyle = xlDot
objChart.SeriesCollection(k).Smooth = False
objChart.SeriesCollection(k).MarkerSize = 2
objChart.SeriesCollection(k).Shadow = False
Else
If k = 2 Then
objChart.SeriesCollection(k).Delete
Else
objChart.SeriesCollection(k).Border.ColorIndex = sm
objChart.SeriesCollection(k).Border.Weight = xlThin
objChart.SeriesCollection(k).Border.LineStyle = xlContinuous
objChart.SeriesCollection(k).MarkerBackgroundColor Index = sm
objChart.SeriesCollection(k).MarkerForegroundColor Index = sm
objChart.SeriesCollection(k).MarkerStyle = xlDiamond
objChart.SeriesCollection(k).Smooth = False
objChart.SeriesCollection(k).MarkerSize = 3
objChart.SeriesCollection(k).Shadow = False
objChart.SeriesCollection(k).ErrorBar Direction:=xlY,
Include:=xlBoth, _
Type:=xlCustom, Amount:=xlapp.Workbooks _
(strXlsFile).Worksheets(sn).Range("C47:C" & lr), _
MinusValues:=xlapp.Workbooks(strXlsFile).Worksheet s _
(sn).Range("C47:C" & lr)
objChart.SeriesCollection(k).ErrorBars.Border.Colo rIndex = eb
objChart.SeriesCollection(k).ErrorBars.Border.Weig ht = xlThin
objChart.SeriesCollection(k).ErrorBars.Border.Line Style =
xlContinuous
End If
End If
objChart.Axes(xlCategory).TickLabels.NumberFormat = "mm/dd/yyyy hh:mm;@"
objChart.Axes(xlCategory, xlPrimary).CategoryType = xlCategoryScale
Loop

Thanks in advance.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format data series (Chart) KRK New Users to Excel 2 December 26th 09 12:23 PM
How many data series can i format Derek Charts and Charting in Excel 4 June 8th 06 05:29 PM
Default Series format Al Camp Charts and Charting in Excel 6 April 24th 06 05:42 PM
1 Chart - Different series format chrisabberton Charts and Charting in Excel 2 July 28th 05 04:59 PM
format data series Jeff Charts and Charting in Excel 3 April 21st 05 11:30 PM


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"