Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Excel > Excel Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-16-2011, 07:41 AM
judicial85 judicial85 is offline Windows 7 Office 2010 (Version 14.0)
Advanced Beginner
 
Join Date: Nov 2010
Posts: 64
judicial85 is on a distinguished road
Default Edit Marker Lines VBA 2010

I have tried for a while now to edit the lines of my chart series in VBA. I am looking for some simple changes to SeriesCollection(1).Select

With Selection
"series line is 2.25 width"
"MARKER line is the default 0.75"
End With

The problem is when I do code as below, the weight command of one of those overwrites the weight command of the other. How do I distinguish between the two kinds of "lines" in VBA so I don't get bloated markers?

Best,
Bryan

Code:
With Selection
    .Format.Line.Visible = msoTrue
    .Border.Color = RGB(0, 0, 0)
    .Format.Line.Weight = 2.25
    .Format.Line.ForeColor.RGB = RGB(0, 255, 0)
    .Format.Line.ForeColor.TintAndShade = 0
    .Format.Line.Transparency = 0
    .Format.Fill.Solid
    .Format.Fill.ForeColor.RGB = RGB(0, 0, 0)
    .Border.Weight = 0.75
        
    End With
PS - The order is somewhat random now as I have tried moving commands around to see what the effects were...
Reply With Quote
  #2  
Old 03-18-2011, 07:26 AM
Kimberly Kimberly is offline Windows 7 64bit Office 2010 64bit
Expert
 
Join Date: May 2010
Posts: 523
Kimberly is on a distinguished road
Default

Why not use the macro recorder?
Reply With Quote
  #3  
Old 03-18-2011, 07:29 AM
Kimberly Kimberly is offline Windows 7 64bit Office 2010 64bit
Expert
 
Join Date: May 2010
Posts: 523
Kimberly is on a distinguished road
Default

I'm not seeing that you can change the outline of markers without changing it of the line, macro or not.
Reply With Quote
  #4  
Old 03-18-2011, 08:48 AM
judicial85 judicial85 is offline Windows 7 Office 2010 (Version 14.0)
Advanced Beginner
 
Join Date: Nov 2010
Posts: 64
judicial85 is on a distinguished road
Default

Macro recorder doesn't pick up any chart formatting changes and "border" and "line" commands seem to talk to different pieces of the chart, but line always seems to trump border...

Just in case, I'd want to clarify... in the "Format Data Series" pop-up, I'm looking to change "Line Style" --> "Width" without (programatically) changing "Marker Line Style" --> "Width" simultaneously.

If it's truly broken, is it possible to alternatively remove "Marker Line Style" "Width" and just display a line? (One can always make the marker sizes large to compensate)
Reply With Quote
  #5  
Old 03-18-2011, 09:30 AM
Kimberly Kimberly is offline Windows 7 64bit Office 2010 64bit
Expert
 
Join Date: May 2010
Posts: 523
Kimberly is on a distinguished road
Default

Have you considered using the button on the Design tab to save your chart as a template?
Reply With Quote
  #6  
Old 03-18-2011, 01:09 PM
judicial85 judicial85 is offline Windows 7 Office 2010 (Version 14.0)
Advanced Beginner
 
Join Date: Nov 2010
Posts: 64
judicial85 is on a distinguished road
Default

Briefly, but sometimes the lines are charted in different orders (depends on when data arrives) which means the colors will probably be assigned to the wrong line; the legend should determine the color as opposed to the order they are plotted.

Bryan
Reply With Quote
Reply

Tags
charts, formatting, vba
Please reply to this thread with any new information or opinions.

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Word 2010 / Grid Lines Word4Dick Word 2 10-24-2012 12:23 PM
Unable to edit a received message w/Outlook 2010 Mona123 Outlook 5 02-22-2012 09:25 AM
MarkAsFinal - 'Edit Anyway' edit popup issue GovindRS PowerPoint 1 06-20-2011 06:43 AM
'Last edit date' markg2 Word 3 12-26-2010 03:27 PM
One specific paragraph marker problem bubble Word 2 11-06-2009 07:59 AM


All times are GMT -7. The time now is 02:20 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft