Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting a range of cells
Message
From
28/10/1999 16:09:36
 
 
To
28/10/1999 00:52:57
General information
Forum:
Microsoft Office
Category:
Excel
Miscellaneous
Thread ID:
00282029
Message ID:
00283388
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform