Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default with selection speed

I know the feeling, thought it was the .Chart at first, until I tried it.

--

HTH

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

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Good catch, Bob! I stared at that for 5 minutes and couldn't see the

error.

Regards,

Vasant.

"Bob Phillips" wrote in message
...
User error.

Worksheets("sheet1").ChartObjects("Chart 1").Chart. _
SeriesCollection(1).Value = "=Sheet1!R1C1:R20C1"

should be

Worksheets("sheet1").ChartObjects("Chart 1").Chart. _
SeriesCollection(1).Values = "=Sheet1!R1C1:R20C1"

--

HTH

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

"crossplatform " wrote in
message ...
May I know what's wrong with this code:
Worksheets("sheet1").ChartObjects("Chart 1").Chart. _
SeriesCollection(1).Value = "=Sheet1!R1C1:R20C1"

and this works perfectly:
Worksheets("sheet1").Activate
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Values = "=Sheet1!R1C1:R20C1"


Vasant Nanavati wrote:
*Without getting into the particulars of your code, I'll just say
that you
rarely need to select any object in Excel. For example:

Workbooks("Book1.xls").Activate
Worksheets("Sheet3").Select
Range("B5").Select
Selection.Copy
Worksheets("Sheet5").Select
Range("C6").Select
ActiveSheet.Paste

is equivalent to:

Workbooks("Book1.xls").Worksheets("Sheet3").Range( "B5").Copy
Destination:= _
Workbooks("Book1.xls").Worksheets("Sheet5").Range( "C6")

If Book1.xls is the active workbook you could omit the reference to
it. Then
the code would simply be:

Worksheets("Sheet3").Range("B5").Copy Destination:= _
Worksheets("Sheet5").Range("C6")

No sheets or ranges have to be activated or selected for this to
work.

--

Vasant




"Ian Mangelsdorf" wrote in message
m...
I have a series of embed charts in a worksheet, all of which need
to
have various changes made. I am currently using code as follows
(extract)

'Sets the series point markers
With Selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlPlus
End With

'sets the depth axis properties
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = MinDepth
.MaximumScale = MaxDepth
.ReversePlotOrder = True
.CrossesAt = MinDepth
End With


In varoious articles on this news group I have seen it mentioned
that
selecting an object slows the code down and isnt nesacarally the
best
option.

I am curious as to what would be the best practice for this
situation *


---
Message posted from http://www.ExcelForum.com/







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
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Can you speed UP drag speed? Ryan W Excel Discussion (Misc queries) 1 October 24th 05 06:09 PM
Speed? Stu[_31_] Excel Programming 11 October 18th 03 09:41 PM


All times are GMT +1. The time now is 11:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"