>Hi,
>
>When using Excel automation, say I want to get values from a range of cells (e.g. A3 to G200), how do you do it? I mean, one cell at a time. I think it would involve setting FOR NEXT but I can't think of how to do it for letters of the cell.
>
>TIA for any suggestions.
Here is some code I found:
with oSheet
lnCols = .UsedRange.columns.count
dimension laFieldNames[m.lnCols, 1]
for lnI = 1 to m.lnCols
lcCellValue = .Cells(1,m.lnI).value
laFieldNames[m.lnI] = strtran(upper(alltrim(m.lcCellValue)),chr(10)," ")
next
endwith
You can get the same way the Columns.Count and Rows.Count for the range.
If it's not broken, fix it until it is.
My Blog