Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there an easier way
Message
De
23/06/2002 21:15:51
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
23/06/2002 18:59:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00671465
Message ID:
00671521
Vues:
17
I understand the use of ranges (I think). The problem is that you don't get fully formed boxes when you use a range. The only way I could get it to work was loop through each cell succesively setting the form for all four sides.

The command .Borders(xlHorizontalInside).LineStyle = xlContinuous and
.Borders(xlHorizontalInside).LineStyle = xlContinuous both gave me an error when used with the range. Without them, you just get 2 vertical lines....not horizontal. If you set a range like your suggesting, you get a border around the entire range, not around each cell.


>>to do this.
>>
>>
>>WITH .Parent.Styles("Cell")
>>			.Borders(xlEdgeTop).LineStyle	 = xlContinuous
>>			.Borders(xlEdgeLeft).LineStyle 	 = xlContinuous
>>			.Borders(xlEdgeRight).LineStyle  = xlContinuous
>>			.Borders(xlEdgeBottom).LineStyle = xlContinuous
>>		ENDWITH
>>
>>		**-- set all cells with borders
>>		FOR lnI = 1 TO .usedRange.columns.count
>>			FOR lnJ = 1 TO .UsedRange.rows.count				lcRange = [.Range("] + CHR(lnI + 64) + ALLTRIM(STR(lnj)) + [").Style = "Cell"]
>>				&lcRange
>>			ENDFOR
>>		ENDFOR
>>
>
>Try to select a range, and format it all at once. Do this with a macro, and look at the recorded commands.
>
>Example of range manipulation (sets FontSize for a range):
>
>
>with oSheet
>.Range(.Cells(1,1), .Cells(5,5)).Font.Size = 20
>
>
>The code may be simpler or more complicated, but it is to your advantage to manipulate entire ranges: there are much less messages to be exchanged between VFP and Excel.
>
>HTH, Hilmar.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform