Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting a range of cells
Message
De
28/10/1999 16:09:36
 
 
À
28/10/1999 00:52:57
Information générale
Forum:
Microsoft Office
Catégorie:
Excel
Divers
Thread ID:
00282029
Message ID:
00283388
Vues:
21
Hi Thomas,

Thanks again for all the help. I did look at the book and will probably buy it. Most of the books I have on VFP do not address Excel and of course my Excel books dont' know VFP.

This Works from VFP 5/6:

* Insert Detail rows
ColStart='C' ** assuming you know the best column to use and it's not the Active Col
RowStart=Excel.ActiveCell.OffSet(+1,0).Row
*Insert Total rows
ColEnd='C'
RowEnd=Excel.ActiveCell.OffSet(-1,0).Row
lcRange=ColStart+LTRIM(STR(RowStart))+':'ColEnd+LTRIM(STR(RowEnd))
.Range(lcRange).DELETE

or if the best col is the Active one:

* Insert Detail rows
ColStart=Excel.ActiveCell.OffSet(+1,0).Column
RowStart=Excel.ActiveCell.OffSet(+1,0).Row
*Insert Total rows
ColEnd=Excel.ActiveCell.OffSet(-1,0).Column
RowEnd=Excel.ActiveCell.OffSet(-1,0).Row
lcRange=LTRIM(STR(ColStart))+LTRIM(STR(RowStart))+':'+LTRIM(STR(ColEnd))+LTRIM(STR(RowEnd))
.Range(lcRange).DELETE
*

Of course you could pass the Col/Row parameters to this .prg.

Have a nice day and get some sleep.

Regards,

Paige
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform