Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
NoelH
 
Posts: n/a
Default 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
  #2   Report Post  
Jon Peltier
 
Posts: n/a
Default 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

  #3   Report Post  
NoelH
 
Posts: n/a
Default 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


  #4   Report Post  
Jon Peltier
 
Posts: n/a
Default 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


  #5   Report Post  
NoelH
 
Posts: n/a
Default 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
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
missing data points causes my line graph not to connect liebw Charts and Charting in Excel 8 November 24th 08 10:15 PM
Charts Line Types for Multiple Data Series not Printing Properly Seanb Charts and Charting in Excel 0 August 22nd 05 06:35 PM
how do I change a line series to a column series in excel? Mati Charts and Charting in Excel 1 May 12th 05 09:32 AM
Graff data series Esrei Excel Discussion (Misc queries) 0 April 21st 05 01:56 PM
How can I set the default line width HighPlanes Charts and Charting in Excel 3 December 3rd 04 05:21 AM


All times are GMT +1. The time now is 05:17 PM.

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

About Us

"It's about Microsoft Excel"