parse excel file

  • Thread starter Thread starter epr
  • Start date Start date
E

epr

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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Parsing 2
parse Excel 4
Turn Off automatic parsing of data in Excel 1
Parsing Data 4
Parsing XML with VBA 0
Parsing a string 10
Excel Concatenate Form Name to Parse for function 1
Using VBA to parse RTD objectdata 3

Back
Top