Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel automation and cell formatting
Message
De
23/08/2011 14:27:51
 
 
À
23/08/2011 13:52:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01521605
Message ID:
01521627
Vues:
50
>>>>Hi All,
>>>>
>>>>I am using Excel automation to populate some cells with data. How can I tell Excel to format a cell as character before sending through the data?
>>>>
>>>>Thanks
>>>
>>>Hi. What Sergey states is what I usually do, too. Another alternative is to FIRST change the cell format to Text, THEN insert the value.
>>
>>OK, how do I change the cell format to text first ?
>
>In Excel, the shortcut to access cell format is Ctrl-1. From the tab "Number", choose "Text".
>
>The macro recorder shows:
>
>
>Selection.NumberFormat = "@"
>
>
>So that would probably translate to something like:
>
>
>oSheet.Cells(nrow, ncol).NumberFormat = "@"
>
>
>or for a larger range:
>
>
>oSheet.Range(oSheet.Cells(1,1), oSheet.Cells(100,1)).NumberFormat = "@"
>
Thanks Hilmar, that does the trick.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform