Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

spreadsheet into excel

Status
Not open for further replies.

petert00

Chemical
May 11, 2005
1
I haven't worked with VBA for a while. I'm trying to write a code that reads a list of numbers from the spreadsheet and average those numbers at every three intervals. Could anyone give me an idea as to how to read the numbers into VBA thanks
 
Replies continue below

Recommended for you

In the worksheet, assign a "name" to the full extent of the list (Insert / Name / Define). Let that name be [tt]MyRange[/tt].

In the VBE, you can now reference any element of that range using the syntax
[tt]Range("MyRange")(RowNumber,ColumnNumber)[/tt]
You can establish the size of the Range with
[tt]Range("MyRange").Rows.Count[/tt]
and
[tt]Range("MyRange").Columns.Count[/tt]

That should be enough to get you started.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor