Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macro for ordering dates chronologically in Words Documents
#18
An excel range can be filled from a 2-dim array using Value property. Dimension roles are different: first dimension is for rows, second for columns.

Code:
Copy      Help
ARRAY(VARIANT) aa.create(b.len 1)
for(i b.lbound b.ubound+1) aa[i 0]=b[2 i]
f.Value=aa


Complete code for testing
Code:
Copy      Help
out

;Create test array
ARRAY(VARIANT) b.create(3 12)
int i j; str s ss
ss=
;january
;february
;march
;april
;may
;june
;july
;august
;september
;october
;november
;december

for i 0 b.len
,b[0 i]=i+1
,s.getl(ss -i)
,b[2 i]=s


ExcelSheet es.Init
Excel.Range f=es.ws.Range(_s.format("C1:C%i" b.len))
;f.Select

ARRAY(VARIANT) aa.create(b.len 1)
for(i b.lbound b.ubound+1) aa[i 0]=b[2 i]
f.Value=aa


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)