Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to program Excel's xlToRight stm in VFP? 1

Status
Not open for further replies.

iyarosh

Programmer
Apr 14, 2003
49
US
Hello, I'm trying to convert Excel's statement into VFP and running out of ideas. THe statement is to select cells in the range from A1 to the last cell populated on the selected row (similar to holding down CTRL+Shift+arrow)
Code:
Range(Selection, Selection.End(xlToRight)).Select
Would highly appreciate if some one could give me a hand with the conversion. Thanks in advance!
 
Code:
#define  xlToRight  -4161 
loExcel=CREATEOBJECT("excel.application")

WITH loExcel
.visible=.t.
.workbooks.add()

FOR lnAddem = 97 TO 110
 .ActiveSheet.range(CHR(lnAddem)+[1]).value=lnAddem 
ENDFOR 

 .ActiveSheet.range([A1]).select
 .ActiveSheet.Range(.ActiveCell.Address, .Selection.End(-4161)).Select
ENDWITH
 
Heck, I defined xlToRight AND hard coded it. Oh well.

Brian
 
Brian,

Thank you! Works like magic!

Igor.
 
That's because VFP IS magic!

Thank you for the star.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top