LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Auto-set Chart Data Range


Referring to an earlier post in this newsgroup entitled 'Cell addresses
selection for chart source,' I'd like to ask for a bit more detailed advice.
I believe the code that Jon posted is the solution to my challenge, however,
I'm not versed in VB to do the easy part. I assume his recs left out the
object references. With that, I tried my hand to no avail...as follows.
Would someone be able to help with the remaining code to complete the
Subroutine?

Worksheets("Chart").ChartObjects("Chart4").Activat e
ActiveSheet.SetrngWholeRange =3D Range("B163:R171")



Also, I defined a pretty rudimentary "test" statement.


For Each rngCell In rngWholeRange.Cells
If {Len(rngCell.Value) =3D 0 Or rngCell.Value =3D 0}Then


Is my syntax correct? Thanks in advance for your help


-----------------FROM EARLIER POST---------------------------

Private Sub CommandButton1_Click()
Dim rngCell As Range
Dim rngWholeRange As Range
Dim rngToChart As Range

SetrngWholeRange =3D Range("B163:R171")

For Each rngCell In rngWholeRange.Cells
If {Len(rngCell.Value) =3D 0 Or rngCell.Value =3D 0}Then
If rngToChart Is Nothing Then
Set rngToChart =3D rngCell
Else
Set rngToChart =3D Union(rngToChart, rngCell)
End If
End If
Next 'rngCell

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
Chart empty with new data in the dynamic range chart. Feejo Excel Discussion (Misc queries) 16 January 3rd 08 10:03 PM
Auto update the chart range for new sheets Access Joe Charts and Charting in Excel 2 December 13th 07 06:42 PM
Auto increment chart range montly comfuted Charts and Charting in Excel 1 July 7th 06 10:58 PM
Dynamic column chart - auto sort on data range jimfrog Charts and Charting in Excel 0 March 29th 06 02:45 PM
Can I use named range in data range box when creating pie chart? BJackson Charts and Charting in Excel 2 August 17th 05 05:37 PM


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

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"