Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

from grid to array

Posted on 1998-08-23
1
Medium Priority
?
151 Views
Last Modified: 2011-09-20
VB5
g = MSFlexigrid
Please help to put it to loop
Dim carray()
Dim i As Integer
ReDim carray(0 To g.Rows)
g.Col = 0
For i = 0 To g.Rows
g.Row = i
carray = f.Text
Next i
///
getting error message Cannot assign to array
decrementing g.rows -1
would not help
Thanks
0
Comment
Question by:mativare
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
mcix earned 80 total points
ID: 1430511
   Dim carray()
    Dim i As Integer
   
    ReDim carray(0 To MSFlexGrid1.Rows - 1)
    MSFlexGrid1.Col = 0
   
    For i = 0 To MSFlexGrid1.Rows - 1
        MSFlexGrid1.Row = i
        carray(i) = MSFlexGrid1.Text
        MsgBox carray(i)
    Next i


Note: this will put the value of Column 0 for each Row in the grid into the variant carray()...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question