Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting values of all cells in a range, one by one
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01480894
Message ID:
01480922
Views:
42
>>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.

Thank you very much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform