Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting values of all cells in a range, one by one
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01480894
Message ID:
01480903
Vues:
67
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform