Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 11
Default Line Equation and R squared disappear

I have a macro that is hiding rows. The charts and the information that is on
them is included in these rows. These are XY scatter charts. I have changed
the properties of the chart to "don't move or size with cells." However, it
still isn't completely working.

If a group of cells is hidden by the macro and then I make a new worksheet
by right clicking the worksheet tab and selecting "move or copy," and then
the macro unhides the same group of cells, the equation for trendline and
R-Squared value dissapears. Instead, there are "x value" data labels on each
point of the line.

After some time and repetition of this, I even had on chart take on the
properties (including source information) of another chart in the same
worksheet.

Can this problem be fixed (an automated fix that is)?

The macro code:

Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Range("B20,J20")) Is Nothing Then Exit Sub
Select Case Target.Address(0, 0)
Case "B20"
Select Case Target.Value
Case 0.9, 0.94, 0.76, 0.75, 0.78
Rows("32:93").EntireRow.Hidden = False
Rows("94:124").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:I$93"
Case 0.84
Rows("32:124").EntireRow.Hidden = False
Rows("63:124").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$62"
Case Else
Rows("32:124").EntireRow.Hidden = False
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$124"
End Select
Case "J20"
Select Case Target.Value
Case 2
Rows("32:124").EntireRow.Hidden = False
Rows("63:124").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:I$62"
Case 3
Rows("63:124").EntireRow.Hidden = False
Rows("94:124").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:I$93"
Case 1
Rows("32:124").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:I$31"
Case Else
Rows("32:124").EntireRow.Hidden = False
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$124"
End Select
End Select
End Sub


Excel file with the macro can be found here (Login is required to access.):

http://www.excelforum.com/attachment...g-minerals.xls


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
Trend line equation cturner08 Charts and Charting in Excel 2 February 5th 09 07:11 PM
Have a chart line completely disappear for a Series... Setts Excel Worksheet Functions 1 June 21st 08 06:45 AM
What's equation for R-Squared value given for chart trendlines? Sarah Charts and Charting in Excel 4 October 29th 07 12:39 PM
The grid line disappear when I type in the cell faylene Excel Discussion (Misc queries) 1 October 8th 06 01:33 AM
Refreshing pivot makes second data series line disappear from chart !!! WhytheQ Excel Discussion (Misc queries) 4 July 4th 06 01:28 PM


All times are GMT +1. The time now is 02:03 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"