Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Excel
123quattro
charting
crashesgpfs
datamap
excel
interopoledde
links
misc
newusers
printing
programming
querydao
sdk
setup
templates
worksheet.functions
  
 
date: Tue, 22 Jul 2008 15:12:03 -0700,    group: microsoft.public.excel.programming        back       


parse excel file   
hello, 

hope to get some help here.

i need to parse some big batch of excel files, some general question:

( the excel file contains some data pages ad a summary page, kind of like a 
report)

I need to look at the content of each cell, then decide what to do next, for 
example, if the cell says ' total income' the i should retrive the next field 
 as the real value as  total income.

question:

1. how do i know the boundary of a sheet, is that limited? 
some times the cell is actually combined from multiple columns, in such 
case, how do i iterate through?


basically, you can see that i am looking for some basic stuff so i can sail 
through the data. 

any help is appreciated.

thx.

-- 
epr
date: Tue, 22 Jul 2008 15:12:03 -0700   author:   epr

RE: parse excel file   
Here are some veryt simple samples.  I'm sure you will get lots of responses 
where to get more info.

'statement below goes to rows.Count = 65536 and moves up until a non-blank 
cell is foud
LastRow = Range("A" & Rows.Count).end (xlup).row

'statment below goes to column IV (columns.Count = 256) and moves left until 
a non-blank cell
LastCol = cells(1,columns.Count).end(xltoleft).Column

Note: Range("A1") is the same as Cells(1,"A") or Cells(1,1)


'add all the cells in column A
total = 0
for RowCount = 1 to Lastrow

   total = total + Range("A" & rowcount)   
next RowCount

'add all the cells in row 1
total = 0
for ColCount = 1 to LastCol

   total = total + Cells(1,Colcount))   
next RowCount


"epr" wrote:

> hello, 
> 
> hope to get some help here.
> 
> i need to parse some big batch of excel files, some general question:
> 
> ( the excel file contains some data pages ad a summary page, kind of like a 
> report)
> 
> I need to look at the content of each cell, then decide what to do next, for 
> example, if the cell says ' total income' the i should retrive the next field 
>  as the real value as  total income.
> 
> question:
> 
> 1. how do i know the boundary of a sheet, is that limited? 
> some times the cell is actually combined from multiple columns, in such 
> case, how do i iterate through?
> 
> 
> basically, you can see that i am looking for some basic stuff so i can sail 
> through the data. 
> 
> any help is appreciated.
> 
> thx.
> 
> -- 
> epr
date: Tue, 22 Jul 2008 19:10:01 -0700   author:   Joel

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us