LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Simple question on With command

Hello I was experimenting with changing graph data in VBA and could do with
some help.

Easy enough to do by selecting the graph in question as in fist example
below.
Is there a way of doing it with the With command (which i gather is much
more processor efficient - an important factor in this scenario). My
attempts below, the first way works fine but the second way I'm struggling
on syntax

Any advice gratefully received

tp

Sub changegraph()

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(2).Values = "=WMP!$BH$4:$BH$304"
End Sub


Sub changegraph2()

With Sheets("sheet1").ChartObjects("Chart 1")
.PlotArea.Select '(I tried omitting this line but no good)
.SeriesCollection(2).Values = "=WMP!$BH$4:$BH$304"
End With
End Sub


 
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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Checking to see that a CHART exists prior to running a simple command Anton Excel Discussion (Misc queries) 0 August 29th 06 06:30 AM
Simple Question WordProc Excel Discussion (Misc queries) 3 April 1st 06 12:19 AM
search string command to answer simple Yes or No [email protected] Excel Worksheet Functions 0 February 21st 06 04:01 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM


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