Msflexgrid Coldata

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
I have not idea about the capabilities of the msflexgrid control. for your
other question:

Range(clmname & temprow).Resize(UBound( _
tempdata), 1).Value = Application.Transpose(tempdata)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top