I'm trying to create graphs in Excel using VB. I need to define a
"Range" and/or "Area", but using the Offset .. function? property? {I
tried sending out a sample of my code from the office, but once checking
this ng from home, couldn't find my own msg, so let me try to explain,
but won't be perfect since the code is there, not here :}
I have multiple charts that I wish to create from data that I have cell
Columns 3 & 4. The data for each chart is 40 rows long. I was trying
to write the VB code such that I would start at cell C1, then select the
Area needed ("C1:D40") by using Offset (something like):
Dim max as Integer
Dim start as Range
Dim end as Range
Dim SelArea as Range ' selection area
max = 40
Set start = Range("C1").Value
Set end = Range(start).Offset(1,max).Value
Set SelArea = Union(start, end)
Select.Range(SelArea)
' from here, I have code for creating the chart from a
' pre-recorded macro.
I was going to, then, have a Do While loop that would continue to use
the start & end values to go thru all the data that I had in the file.
However, there is something wrong with the way that I am trying to set
the Ranges, and I went thru all the help indexes that I could find for
all the keywords - Range, Offset, Select, Area, etc. I could not find
what I needed that would tell me how to do the above.
Any help GREATLY appreciated.
TIA,
Glenn
Set