Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking Against Excel List via QM
#18
Anyways, I re-wrote the whole code successfully with result and shortened it, after a better understanding of how ExcelSheet itself is used.
However, I still have a problem with selecting only the used range:

Macro NC VCC Release Corrections
Code:
Copy      Help
;;Declare Variables
ARRAY(str) removeNamesList, SANamesCheckList
int counter1, counter2

int w1=act(win("Microsoft Excel - LR Sales" "XLMAIN")) ;;Obtain the particular sales file handle and activate it.
ExcelSheet esData.Init("Data") ;;Initialize an ExcelSheet object
ExcelSheet esVCC.Init("VCC Release Spool") ;;Initialize an ExcelSheet object

;;Initialize all variables to be sure
counter1=0
counter2=0

;Obtain 2 Excel lists(dynamic ranges) into arrays
esData.CellsToArray(removeNamesList "M:M") ;;Obtain list of names from 'Data' Sheet that have to be replaced/removed - Master List
esVCC.CellsToArray(SANamesCheckList "G:G") ;;Obtain list of name from 'VCC Release Sheet' that need to be checked against Master List

;arrayCheckRoutine
;;Check one array against another and change those not in Master list
for counter1 1 SANamesCheckList.len
,for counter2 1 removeNamesList.len ;;Loop through Master List Array
,,;out SANamesCheckList[0 counter1]
,,;out removeNamesList[0 counter2]
,,if SANamesCheckList[0 counter1]=removeNamesList[0 counter2] ;;Check if current SANamesCheck is in SANamesMaster list
,,,goto obtainSANameFromAL
,,,break

ret ;;Ends Macro as the 'SANamesCheck' list is now fully checked.

;obtainSANameFromAL
;;Check Autoline system for the correct SA Name and replace in Excel
out SANamesCheckList[0 counter1]
Best Regards,
Philip


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)