PC Review


Reply
Thread Tools Rate Thread

Range of Object _Global Failed

 
 
Jeffrey Marks
Guest
Posts: n/a
 
      13th Jul 2011

I'm trying to create multiple charts via a macro in Excel 2007.

I'm getting a 1004 - Range of Object _Global Failed on the indicated statement. I believe I've done something wrong with the last Range in that statement, but I'm not sure what.


Sub OATChartCreate()

Dim chtNew As Chart
Dim i As Integer '<<<
ActiveCell.Resize(2.6).Select
ActiveSheet.Shapes.AddChart.Select
Set chtNew = ActiveChart
For i = 1 To 109 '<<<
Range("F1:K1,F2:K2").Select
Range("F2").Activate
ActiveCell.Resize(2.6).Select
ActiveSheet.Shapes.AddChart.Select
Set chtNew = ActiveChart
>>> chtNew.SetSourceData Source:=Range( _

"'OAT Test Charts Data_Crosstab'!$F$1:$K$1, Range(ActiveCell,ActiveCell.Offset(0,6)).Select" _
) <<<
chtNew.ChartType = xlColumnClustered
chtNew.Legend.Delete
chtNew.HasAxis(xlValue) = True
chtNew.Axes(xlValue).MinimumScale = 0
chtNew.Axes(xlValue).MaximumScale = 1
chtNew.Axes(xlValue).MajorUnit = 0.1
chtNew.Axes(xlValue).MajorUnit = 0.2
chtNew.Axes(xlValue).TickLabels.NumberFormat = "0.00%"
chtNew.Axes(xlValue).TickLabels.NumberFormat = "0%"
ActiveChart.ChartArea.Select
chtNew.SetElement (msoElementPrimaryValueAxisTitleVertical)
chtNew.SetElement (msoElementChartTitleAboveChart)
chtNew.ChartTitle.Text = "Adams County - 8th Grade Mathematics Results"
chtNew.Axes(xlValue, xlPrimary).AxisTitle.Text = "Percent Passing"
Range("F2").Offset(i, 0).Select
Next i
End Sub

Thanks

Jeff
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding named range gives error "method range of object _Global failed " Gunnar Johansson Microsoft Excel Programming 3 10th Aug 2004 01:54 PM
Method 'Range" of object'_Global' failed =?Utf-8?B?VGlt?= Microsoft Excel Programming 2 23rd Feb 2004 09:37 PM
Method 'Range' of object '_Global' failed Brian Morris Microsoft Excel Programming 1 11th Dec 2003 12:04 AM
"Run-time error '1004'" Method 'Range' of object '_global' failed. haisat Microsoft Excel Programming 0 20th Oct 2003 12:13 PM
Method 'Range' of object '_Global' failed Mohanasundaram Microsoft Excel Programming 1 25th Aug 2003 01:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 AM.