Using VB w/ Excel 
Author Message
 Using VB w/ Excel

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



Tue, 11 Jul 2000 03:00:00 GMT  
 Using VB w/ Excel

On Fri, 23 Jan 1998 23:27:35 -0500, Glenn Bagrowski

Quote:

>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):

  Range(Cells(1, 1), Cells(x, y)).Select

Quote:
>    Any help GREATLY appreciated.  

If that helps, you're welcome.

---

Cal Stover
Remove the x to reply



Wed, 12 Jul 2000 03:00:00 GMT  
 Using VB w/ Excel

Glenn,

I would suggest you to post your message on
"Microsoft.Public.Excel.Programming"  NG to get
an answer -- Very unlikely that you'll get it here.

Regards, Davie

Quote:

> 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



Thu, 13 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem using VB in Excel 2000

2. Making a graph / chart using VB and Excel

3. Using VB with Excel

4. Importing from Excel to Excel using VB.

5. Excel to VB and VB to Excel

6. VB and Excel problem - VB corrupts Excel environment

7. Compatibility Problem Using MS Excel 97 VBA on Excel 2000/XP - Causes crashes

8. Running VBA code in EXcel from VB6 using EXcel Objects

9. Saving an Excel file without using Excel

10. Saving an Excel file without using Excel

11. Running an excel macro using excel 8 obj lib

12. Using an Excel file without having Microsoft Excel installed

 

 
Powered by phpBB® Forum Software