Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default About chart with a macro

Hi
I have this in a Macro
It works before when i try
but now when i record a new macro it dosn't work
Her it is
Sheets("Ark1").Select
Range("A1:A5,D1:D5").Select
Range("D1").Activate
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Ark1").Range("A1:A5,D1:D5"), _
PlotBy:=xlRows
ActiveChart.Location Whe=xlLocationAsNewSheet
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With


My error is in Range("A1:A5,D1:D5").Select
the same error if i forget
Sheets("Ark1").Select

Hope someone can help

Alvin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default About chart with a macro

Hi Alvin,

This worked for me. Copied your code and it worked fine. I knocked off the
select and activate since it doesn't seem to be needed and worked the same.

So in reality, I have offered no solution 'cept it worked for me. Or at
least produced a chart of some kind.

Sub ChartIt()
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Ark1") _
.Range("A1:A5,D1:D5"), PlotBy:=xlRows
ActiveChart.Location Whe=xlLocationAsNewSheet
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub

HTH
Regards,
Howard

"alvin Kuiper" wrote in message
...
Hi
I have this in a Macro
It works before when i try
but now when i record a new macro it dosn't work
Her it is
Sheets("Ark1").Select
Range("A1:A5,D1:D5").Select
Range("D1").Activate
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Ark1").Range("A1:A5,D1:D5"),
_
PlotBy:=xlRows
ActiveChart.Location Whe=xlLocationAsNewSheet
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With


My error is in Range("A1:A5,D1:D5").Select
the same error if i forget
Sheets("Ark1").Select

Hope someone can help

Alvin




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
Macro to change position of chart labels on line chart Shane Henderson[_2_] Charts and Charting in Excel 1 May 27th 11 09:31 AM
Chart macro sonicscooter Charts and Charting in Excel 4 April 19th 09 05:32 PM
chart macro mohavv Excel Discussion (Misc queries) 6 June 5th 08 02:31 AM
Chart Macro zephyr Charts and Charting in Excel 1 December 5th 07 04:37 PM
Chart using Macro Abhijeet Charts and Charting in Excel 0 August 1st 05 05:00 PM


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