Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
May 11, 2005
Messages
1
Location
US
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
 
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

Back
Top