02-23-2009, 06:11 PM
Hi there...
I have a macro and one problem.. the macro checks for the length of the numbers and if they are too short it lengthens them by adding a zero... what I want is that if the number is changed the number is replaced in the excelsheet...
this is my macro so far....
out
ARRAY(str) a
ExcelSheet es.Init
es.GetCells(a) ;;gets all cells. To get only selected cells, use this: es.GetCells(a "sel")
int r c
for r 0 a.len
,if(mes("Row %i" "" "OC" r+1) != 'O') break
,for c 0 a.len(1)
,,str& s=a[c r]
,,str s1
,,if(findrx(s "\d\d\d" 0 16 s1)>0) mes s1
,,out s
,,out s.len
,,if s.len=3
,,,s - "0"
any help is appreciated...
tia
I have a macro and one problem.. the macro checks for the length of the numbers and if they are too short it lengthens them by adding a zero... what I want is that if the number is changed the number is replaced in the excelsheet...
this is my macro so far....
out
ARRAY(str) a
ExcelSheet es.Init
es.GetCells(a) ;;gets all cells. To get only selected cells, use this: es.GetCells(a "sel")
int r c
for r 0 a.len
,if(mes("Row %i" "" "OC" r+1) != 'O') break
,for c 0 a.len(1)
,,str& s=a[c r]
,,str s1
,,if(findrx(s "\d\d\d" 0 16 s1)>0) mes s1
,,out s
,,out s.len
,,if s.len=3
,,,s - "0"
any help is appreciated...
tia