JERRYFOOTE
Programmer
Using VFP9 and Excel 2003
Everything was going fine and then I added barcods in the format “0001”,”0002” ect
Now the find command locates the first record with “0001” so a barcode “8991202000123” is found
I understand that there are aruguments to the find command such as wholewords but I cannot figure out how to code for that.
I hope you can see my problem and explain how to correct the syntax to find wholewords
Thanks Jerry
Select UPINVENTORY
Scan
Target=Alltrim(UPINVENTORY.BARCODE)
Found=.F.
Try
rowrange="B1:B"+Transform(Thisform.MAXROW.Value)
=====================================================================
Found=Thisform.oExcel.Range(rowrange).Find(Target).Select && this is line I need to fix
=====================================================================
Endtry
If Found
LAST_ADDRESS = Thisform.oExcel.ActiveCell.Address
LAST_ROW = Thisform.oExcel.ActiveCell.Row
Column=Alltrim(UPINVENTORY.colname)
NEW_ADDRESS="$"+Transform(Column)+"$"+Transform(LAST_ROW)
Thisform.oExcel.Range(NEW_ADDRESS).NumberFormat = "0.00"
If Thisform.upinventry.Value=2
newvalue=Thisform.oExcel.Range(NEW_ADDRESS).Value
If ! Isnull(newvalue)
Thisform.oExcel.Range(NEW_ADDRESS).Value =newvalue+UPINVENTORY.quanity
Else
Thisform.oExcel.Range(NEW_ADDRESS).Value = UPINVENTORY.quanity
Endif
Else
Thisform.oExcel.Range(NEW_ADDRESS).Value = UPINVENTORY.quanity
Endif
Else
Endif
Endscan
Everything was going fine and then I added barcods in the format “0001”,”0002” ect
Now the find command locates the first record with “0001” so a barcode “8991202000123” is found
I understand that there are aruguments to the find command such as wholewords but I cannot figure out how to code for that.
I hope you can see my problem and explain how to correct the syntax to find wholewords
Thanks Jerry
Select UPINVENTORY
Scan
Target=Alltrim(UPINVENTORY.BARCODE)
Found=.F.
Try
rowrange="B1:B"+Transform(Thisform.MAXROW.Value)
=====================================================================
Found=Thisform.oExcel.Range(rowrange).Find(Target).Select && this is line I need to fix
=====================================================================
Endtry
If Found
LAST_ADDRESS = Thisform.oExcel.ActiveCell.Address
LAST_ROW = Thisform.oExcel.ActiveCell.Row
Column=Alltrim(UPINVENTORY.colname)
NEW_ADDRESS="$"+Transform(Column)+"$"+Transform(LAST_ROW)
Thisform.oExcel.Range(NEW_ADDRESS).NumberFormat = "0.00"
If Thisform.upinventry.Value=2
newvalue=Thisform.oExcel.Range(NEW_ADDRESS).Value
If ! Isnull(newvalue)
Thisform.oExcel.Range(NEW_ADDRESS).Value =newvalue+UPINVENTORY.quanity
Else
Thisform.oExcel.Range(NEW_ADDRESS).Value = UPINVENTORY.quanity
Endif
Else
Thisform.oExcel.Range(NEW_ADDRESS).Value = UPINVENTORY.quanity
Endif
Else
Endif
Endscan