arc90 lab | tools: Link Thumbnail
Excel Help Forum
ExcelTip.com
Account Icon Account Icon Account Icon
ExcelTip.com

Go Back   Excel Help Forum > Microsoft Office Application Help - Excel Help forum > Excel Programming > Excel Charting

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-02-2005, 06:17 PM
Jon Peltier
Guest
 
Posts: n/a
Re: format data series line width default

You can't set the line width the same as you can modify the color
palette, but you can format the line width and the rest of the chart
features, then save the chart as a custom chart type:

http://peltiertech.com/Excel/ChartsH...stomTypes.html

The syntax for setting the line width in code is easy enough to obtain.
Turn on the macro recorder, then change the line width of a series, then
see what the recorder recorded. I just got this:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 11/1/2005 by Jon Peltier
'

'
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.ColorIndex = 57
.Weight = xlMedium
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlAutomatic
.MarkerForegroundColorIndex = xlAutomatic
.MarkerStyle = xlAutomatic
.Smooth = False
.MarkerSize = 7
.Shadow = False
End With
End Sub

which when ignoring the defaults and irrelevant changes is reduced to this:

Sub Macro2a()
ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______



NoelH wrote:

> Hi
> Is there a way of setting the default width of lines for a series in line
> chart? like in the tools->options->color, where you can set the default
> colors. ( or the vb code of setting the colours ActiveWorkbook.Colors(25) =
> RGB(51, 102, 255))
> many thanks in advance
> Noel

Reply With Quote
  #2  
Old 11-02-2005, 06:17 PM
NoelH
Guest
 
Posts: n/a
Re: format data series line width default

Hi Jon
Thank you for your reply. however I have different number of series. ie
SeriesCollection (1) ~ (7). I'm having trouble in writing the loop to input
the variable, I have been using if...then. [if there is data series (4), then
run the

ActiveChart.SeriesCollection(1).Border.Weight = xlMedium

I'm working on fixing this error in my learning.

Thanks for your help.

- Noel

"Jon Peltier" wrote:

> You can't set the line width the same as you can modify the color
> palette, but you can format the line width and the rest of the chart
> features, then save the chart as a custom chart type:
>
> http://peltiertech.com/Excel/ChartsH...stomTypes.html
>
> The syntax for setting the line width in code is easy enough to obtain.
> Turn on the macro recorder, then change the line width of a series, then
> see what the recorder recorded. I just got this:
>
> Sub Macro2()
> '
> ' Macro2 Macro
> ' Macro recorded 11/1/2005 by Jon Peltier
> '
>
> '
> ActiveChart.SeriesCollection(1).Select
> With Selection.Border
> .ColorIndex = 57
> .Weight = xlMedium
> .LineStyle = xlContinuous
> End With
> With Selection
> .MarkerBackgroundColorIndex = xlAutomatic
> .MarkerForegroundColorIndex = xlAutomatic
> .MarkerStyle = xlAutomatic
> .Smooth = False
> .MarkerSize = 7
> .Shadow = False
> End With
> End Sub
>
> which when ignoring the defaults and irrelevant changes is reduced to this:
>
> Sub Macro2a()
> ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
> End Sub
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Peltier Technical Services
> Tutorials and Custom Solutions
> http://PeltierTech.com/
> _______
>
>
>
> NoelH wrote:
>
> > Hi
> > Is there a way of setting the default width of lines for a series in line
> > chart? like in the tools->options->color, where you can set the default
> > colors. ( or the vb code of setting the colours ActiveWorkbook.Colors(25) =
> > RGB(51, 102, 255))
> > many thanks in advance
> > Noel

>

Reply With Quote
  #3  
Old 11-02-2005, 06:17 PM
Jon Peltier
Guest
 
Posts: n/a
Re: format data series line width default

Two ways come to mind.

Dim srs as Series
For Each srs In ActiveChart.SeriesCollection
srs.Border.Weight = xlMedium
Next

or

Dim iSrs as Integer
For iSrs = 1 To ActiveChart.SeriesCollection.Count
ActiveChart.SeriesCollection(iSrs).Border.Weight = xlMedium
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


NoelH wrote:
> Hi Jon
> Thank you for your reply. however I have different number of series. ie
> SeriesCollection (1) ~ (7). I'm having trouble in writing the loop to input
> the variable, I have been using if...then. [if there is data series (4), then
> run the
>
> ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
>
> I'm working on fixing this error in my learning.
>
> Thanks for your help.
>
> - Noel
>
> "Jon Peltier" wrote:
>
>
>>You can't set the line width the same as you can modify the color
>>palette, but you can format the line width and the rest of the chart
>>features, then save the chart as a custom chart type:
>>
>> http://peltiertech.com/Excel/ChartsH...stomTypes.html
>>
>>The syntax for setting the line width in code is easy enough to obtain.
>>Turn on the macro recorder, then change the line width of a series, then
>>see what the recorder recorded. I just got this:
>>
>>Sub Macro2()
>>'
>>' Macro2 Macro
>>' Macro recorded 11/1/2005 by Jon Peltier
>>'
>>
>>'
>> ActiveChart.SeriesCollection(1).Select
>> With Selection.Border
>> .ColorIndex = 57
>> .Weight = xlMedium
>> .LineStyle = xlContinuous
>> End With
>> With Selection
>> .MarkerBackgroundColorIndex = xlAutomatic
>> .MarkerForegroundColorIndex = xlAutomatic
>> .MarkerStyle = xlAutomatic
>> .Smooth = False
>> .MarkerSize = 7
>> .Shadow = False
>> End With
>>End Sub
>>
>>which when ignoring the defaults and irrelevant changes is reduced to this:
>>
>>Sub Macro2a()
>> ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
>>End Sub
>>
>>- Jon
>>-------
>>Jon Peltier, Microsoft Excel MVP
>>Peltier Technical Services
>>Tutorials and Custom Solutions
>>http://PeltierTech.com/
>>_______
>>
>>
>>
>>NoelH wrote:
>>
>>
>>>Hi
>>>Is there a way of setting the default width of lines for a series in line
>>>chart? like in the tools->options->color, where you can set the default
>>>colors. ( or the vb code of setting the colours ActiveWorkbook.Colors(25) =
>>>RGB(51, 102, 255))
>>>many thanks in advance
>>>Noel

>>

Reply With Quote
  #4  
Old 11-02-2005, 06:20 PM
NoelH
Guest
 
Posts: n/a
format data series line width default

Hi
Is there a way of setting the default width of lines for a series in line
chart? like in the tools->options->color, where you can set the default
colors. ( or the vb code of setting the colours ActiveWorkbook.Colors(25) =
RGB(51, 102, 255))
many thanks in advance
Noel
Reply With Quote
  #5  
Old 11-02-2005, 06:20 PM
Jon Peltier
Guest
 
Posts: n/a
Re: format data series line width default

You can't set the line width the same as you can modify the color
palette, but you can format the line width and the rest of the chart
features, then save the chart as a custom chart type:

http://peltiertech.com/Excel/ChartsH...stomTypes.html

The syntax for setting the line width in code is easy enough to obtain.
Turn on the macro recorder, then change the line width of a series, then
see what the recorder recorded. I just got this:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 11/1/2005 by Jon Peltier
'

'
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.ColorIndex = 57
.Weight = xlMedium
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlAutomatic
.MarkerForegroundColorIndex = xlAutomatic
.MarkerStyle = xlAutomatic
.Smooth = False
.MarkerSize = 7
.Shadow = False
End With
End Sub

which when ignoring the defaults and irrelevant changes is reduced to this:

Sub Macro2a()
ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______



NoelH wrote:

> Hi
> Is there a way of setting the default width of lines for a series in line
> chart? like in the tools->options->color, where you can set the default
> colors. ( or the vb code of setting the colours ActiveWorkbook.Colors(25) =
> RGB(51, 102, 255))
> many thanks in advance
> Noel

Reply With Quote
  #6  
Old 11-02-2005, 06:20 PM
NoelH
Guest
 
Posts: n/a
Re: format data series line width default

Hi Jon
Thank you for your reply. however I have different number of series. ie
SeriesCollection (1) ~ (7). I'm having trouble in writing the loop to input
the variable, I have been using if...then. [if there is data series (4), then
run the

ActiveChart.SeriesCollection(1).Border.Weight = xlMedium

I'm working on fixing this error in my learning.

Thanks for your help.

- Noel

"Jon Peltier" wrote:

> You can't set the line width the same as you can modify the color
> palette, but you can format the line width and the rest of the chart
> features, then save the chart as a custom chart type:
>
> http://peltiertech.com/Excel/ChartsH...stomTypes.html
>
> The syntax for setting the line width in code is easy enough to obtain.
> Turn on the macro recorder, then change the line width of a series, then
> see what the recorder recorded. I just got this:
>
> Sub Macro2()
> '
> ' Macro2 Macro
> ' Macro recorded 11/1/2005 by Jon Peltier
> '
>
> '
> ActiveChart.SeriesCollection(1).Select
> With Selection.Border
> .ColorIndex = 57
> .Weight = xlMedium
> .LineStyle = xlContinuous
> End With
> With Selection
> .MarkerBackgroundColorIndex = xlAutomatic
> .MarkerForegroundColorIndex = xlAutomatic
> .MarkerStyle = xlAutomatic
> .Smooth = False
> .MarkerSize = 7
> .Shadow = False
> End With
> End Sub
>
> which when ignoring the defaults and irrelevant changes is reduced to this:
>
> Sub Macro2a()
> ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
> End Sub
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Peltier Technical Services
> Tutorials and Custom Solutions
> http://PeltierTech.com/
> _______
>
>
>
> NoelH wrote:
>
> > Hi
> > Is there a way of setting the default width of lines for a series in line
> > chart? like in the tools->options->color, where you can set the default
> > colors. ( or the vb code of setting the colours ActiveWorkbook.Colors(25) =
> > RGB(51, 102, 255))
> > many thanks in advance
> > Noel

>

Reply With Quote
  #7  
Old 11-02-2005, 06:20 PM
Jon Peltier
Guest
 
Posts: n/a
Re: format data series line width default

Two ways come to mind.

Dim srs as Series
For Each srs In ActiveChart.SeriesCollection
srs.Border.Weight = xlMedium
Next

or

Dim iSrs as Integer
For iSrs = 1 To ActiveChart.SeriesCollection.Count
ActiveChart.SeriesCollection(iSrs).Border.Weight = xlMedium
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


NoelH wrote:
> Hi Jon
> Thank you for your reply. however I have different number of series. ie
> SeriesCollection (1) ~ (7). I'm having trouble in writing the loop to input
> the variable, I have been using if...then. [if there is data series (4), then
> run the
>
> ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
>
> I'm working on fixing this error in my learning.
>
> Thanks for your help.
>
> - Noel
>
> "Jon Peltier" wrote:
>
>
>>You can't set the line width the same as you can modify the color
>>palette, but you can format the line width and the rest of the chart
>>features, then save the chart as a custom chart type:
>>
>> http://peltiertech.com/Excel/ChartsH...stomTypes.html
>>
>>The syntax for setting the line width in code is easy enough to obtain.
>>Turn on the macro recorder, then change the line width of a series, then
>>see what the recorder recorded. I just got this:
>>
>>Sub Macro2()
>>'
>>' Macro2 Macro
>>' Macro recorded 11/1/2005 by Jon Peltier
>>'
>>
>>'
>> ActiveChart.SeriesCollection(1).Select
>> With Selection.Border
>> .ColorIndex = 57
>> .Weight = xlMedium
>> .LineStyle = xlContinuous
>> End With
>> With Selection
>> .MarkerBackgroundColorIndex = xlAutomatic
>> .MarkerForegroundColorIndex = xlAutomatic
>> .MarkerStyle = xlAutomatic
>> .Smooth = False
>> .MarkerSize = 7
>> .Shadow = False
>> End With
>>End Sub
>>
>>which when ignoring the defaults and irrelevant changes is reduced to this:
>>
>>Sub Macro2a()
>> ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
>>End Sub
>>
>>- Jon
>>-------
>>Jon Peltier, Microsoft Excel MVP
>>Peltier Technical Services
>>Tutorials and Custom Solutions
>>http://PeltierTech.com/
>>_______
>>
>>
>>
>>NoelH wrote:
>>
>>
>>>Hi
>>>Is there a way of setting the default width of lines for a series in line
>>>chart? like in the tools->options->color, where you can set the default
>>>colors. ( or the vb code of setting the colours ActiveWorkbook.Colors(25) =
>>>RGB(51, 102, 255))
>>>many thanks in advance
>>>Noel

>>

Reply With Quote
  #8  
Old 11-02-2005, 10:55 PM
NoelH
Guest
 
Posts: n/a
Re: format data series line width default

Thank you, works fantastically

"Jon Peltier" wrote:

> Two ways come to mind.
>
> Dim srs as Series
> For Each srs In ActiveChart.SeriesCollection
> srs.Border.Weight = xlMedium
> Next
>
> or
>
> Dim iSrs as Integer
> For iSrs = 1 To ActiveChart.SeriesCollection.Count
> ActiveChart.SeriesCollection(iSrs).Border.Weight = xlMedium
> Next
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Peltier Technical Services
> Tutorials and Custom Solutions
> http://PeltierTech.com/
> _______
>
>
> NoelH wrote:
> > Hi Jon
> > Thank you for your reply. however I have different number of series. ie
> > SeriesCollection (1) ~ (7). I'm having trouble in writing the loop to input
> > the variable, I have been using if...then. [if there is data series (4), then
> > run the
> >
> > ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
> >
> > I'm working on fixing this error in my learning.
> >
> > Thanks for your help.
> >
> > - Noel
> >
> > "Jon Peltier" wrote:
> >
> >
> >>You can't set the line width the same as you can modify the color
> >>palette, but you can format the line width and the rest of the chart
> >>features, then save the chart as a custom chart type:
> >>
> >> http://peltiertech.com/Excel/ChartsH...stomTypes.html
> >>
> >>The syntax for setting the line width in code is easy enough to obtain.
> >>Turn on the macro recorder, then change the line width of a series, then
> >>see what the recorder recorded. I just got this:
> >>
> >>Sub Macro2()
> >>'
> >>' Macro2 Macro
> >>' Macro recorded 11/1/2005 by Jon Peltier
> >>'
> >>
> >>'
> >> ActiveChart.SeriesCollection(1).Select
> >> With Selection.Border
> >> .ColorIndex = 57
> >> .Weight = xlMedium
> >> .LineStyle = xlContinuous
> >> End With
> >> With Selection
> >> .MarkerBackgroundColorIndex = xlAutomatic
> >> .MarkerForegroundColorIndex = xlAutomatic
> >> .MarkerStyle = xlAutomatic
> >> .Smooth = False
> >> .MarkerSize = 7
> >> .Shadow = False
> >> End With
> >>End Sub
> >>
> >>which when ignoring the defaults and irrelevant changes is reduced to this:
> >>
> >>Sub Macro2a()
> >> ActiveChart.SeriesCollection(1).Border.Weight = xlMedium
> >>End Sub
> >>
> >>- Jon
> >>-------
> >>Jon Peltier, Microsoft Excel MVP
> >>Peltier Technical Services
> >>Tutorials and Custom Solutions
> >>http://PeltierTech.com/
> >>_______
> >>
> >>
> >>
> >>NoelH wrote:
> >>
> >>
> >>>Hi
> >>>Is there a way of setting the default width of lines for a series in line
> >>>chart? like in the tools->options->color, where you can set the default
> >>>colors. ( or the vb code of setting the colours ActiveWorkbook.Colors(25) =
> >>>RGB(51, 102, 255))
> >>>many thanks in advance
> >>>Noel
> >>

>

Reply With Quote
Reply

Bookmarks

New topics in Excel Charting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -4. The time now is 05:12 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0