View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
vishal vishal is offline
external usenet poster
 
Posts: 11
Default Msflexgrid Coldata

Hi All,
I am using MSFlexgrid control in one of my userform of Excel.
I want to get data of a particular column (e.g. Column # 2) and store it in
an array. Is there any simple way of doing it instead of using loop (for,
while)?
Currently I am doing following way:

Dim tempdata()
Redim tempdata (msflexgrid1.rows)

for i = 0 to msflexgrid1.rows-1
tempdata(i) = msflexgrid1.textmatrix(i,1)
next i

But if I try to do the same with following code then it gives error.
Dim tempdata()
tempdata = msflexgrid1.coldata(1)

This gives a compile error! Could you please guide me for this?

Second-
Using for loop method, I am able to write complete data to the array but
while doing following
Range(clmname & temprow).Resize(UBound(tempdata), 1).Value = tempdata
It only writes the first data!
Could you help me for this?

Regards,
Vishal.