Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error number 1004

Hi to everybody,

I use the line below to select data for creating a chart:

ActiveChart.SetSourceData Source:=Sheets("résultats").Range
(Cells(1, 1), Cells(k + 1, i + 1)), _
PlotBy:=xlRows

I have the error number 1004 when I execute this line. I
know that I can not use Cells inside a Range procedure but
how can I select a range of cells in some other way?

Thanks for the help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Error number 1004

Alain,

You can use Cells inside a Range property, but your problem is probably
caused by not qualifying the statement.

Try

With Sheets("résultats")
ActiveChart.SetSourceData Source:=.Range(.Cells(1, 1), .Cells(k + 1, i +
1)), _
PlotBy:=xlRows
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Alain Turgeon" wrote in message
...
Hi to everybody,

I use the line below to select data for creating a chart:

ActiveChart.SetSourceData Source:=Sheets("résultats").Range
(Cells(1, 1), Cells(k + 1, i + 1)), _
PlotBy:=xlRows

I have the error number 1004 when I execute this line. I
know that I can not use Cells inside a Range procedure but
how can I select a range of cells in some other way?

Thanks for the help!


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
error 1004 (VBA) vsiat Excel Discussion (Misc queries) 1 May 15th 06 07:17 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
VBA error - run-time error '1004': Romanian37 Excel Programming 3 May 21st 04 03:25 PM


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