How do i get eh number of value in en excel file in specific column?
Hi,
I'm reading an excel file with few columns and want to select random value from specific column. and i have problem with 2 things:
1. I want to select the column by its header or index
2. Once i found the right header each column had different values and different number of values below, for those values i would like to select a random value. my question is how do i determine how many values i have for each column so i can use the Random(min, max) func to select a random value.
My script:
// Open Devices_ModelSetup.xlsx for reading
oExcelApp.Workbooks.Open("C:\\TestComplete Database\\Devices_ModelSetup.xlsx");
for(i = 1; i <= 12; i++)
if(SeriesValueFromUI == VarToString(oExcelApp.Cells(1, i)))
NumberOfModels = oExcelApp.Cells.Range
for(k = 1; VarToString(oExcelApp.Cells(k, i)) != "" ; k++)
ModelValue = VarToInt(oExcelApp.Cells(Random(1, k), i))
Thanks