Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I tried:
vPointStart = MIN(ActiveDocument.fields("Field").GetSelectedValues)
vPointEnd = MAX(ActiveDocument.fields("Field").GetSelectedValues)
I receive: mismatch of type MIN
How I can receive max and min values from the list of the chosen values in Sub?
thx
Hi,
I don't know why this is not working.
But I can suggest to use script:
sub test
set vVariable = ActiveDocument.fields("Time").GetSelectedValues
for i = 0 to vVariable.Count-1
'msgbox(vVariable.Item(i).text)
if vMax < vVariable.Item(i).text then vMax = vVariable.Item(i).text
if vMin > vVariable.Item(i).text then vMin = vVariable.Item(i).text
next
msgbox(vMax)
msgbox(vMin)
end sub
Hey!!
Did You try it? Is it works?
You should sort your values before setting minimum and maximum values.
Please refer to below:
OrderedDatesTable:
LOAD TARIH RESIDENT EXCEL1 ORDER BY TARIH ASC;
LET varMinDate = Num(Peek('TARIH', 0, 'OrderedDatesTable'));
LET varMaxDate = Num(Peek('TARIH', -1, 'OrderedDatesTable'));