Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default xyScatterChart macro works on WinXP Pro & not on WinXP Home?

I have a ScatterChart macro that works perfectly with Excel2000 on my Win XP Pro
computer. I select two columns and click on the macro and the xyScatterChart is
displayed.

When I moved this exact same code to my new Laptop with Excel2000 and WinXP
Home, the macro would not produce a xyScatterChart but produced a double line
chart with two lines(two sets of points) for the selected two columns instead of
an xyScatterChart.

I can't figure out why the code below works on my WinXP Pro desktop and not the
same on my WinXP Home laptop.

Thanks for any help.

Dennis

====myScatterChart Code======================
Option Explicit
Sub myScatterChart()

'On Error Resume Next
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim curwk As Worksheet
Dim SS As String
Dim myCell As Range
Dim rng As Range
Dim myName As String
Dim ChartName As String
Dim ii As Long
ii = 0
myName = ""

SS = ActiveSheet.Name
Set rng = Selection
For Each myCell In rng
ii = ii + 1
If Not IsNumeric(myCell.Value) Then myName = myName & myCell.Value
Next myCell

Charts.Add

ChartName = ActiveChart.Name
If myName < "" And Not myNameExists(myName) Then ActiveChart.Name = myName

With ActiveChart
.ChartType = xlXYScatter
.Location Whe=xlLocationAsNewSheet
.Move After:=Sheets(Sheets.Count)
.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Interior
.ColorIndex = 2
.PatternColorIndex = 1
.Pattern = xlSolid
End With
With .Axes(xlCategory)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
With .Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With

.SeriesCollection(1).Trendlines.Add(Type:=xlLinear , Forward _
:=0, Backward:=0, DisplayEquation:=True, DisplayRSquared:=True).Select
.PlotArea.Select
End With

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True

End Sub
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
Runtime error for macro that works in workbook created in Crystal Excel Discussion (Misc queries) 1 June 22nd 05 08:43 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro does not run when data refreshed Larry Lehman Excel Discussion (Misc queries) 0 January 16th 05 07:31 PM


All times are GMT +1. The time now is 09:53 AM.

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"