Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleSee which FlexGrid rows the user has selected
KeywordsFlexGrid, selected, rows
CategoriesControls
 
Use the Row and RowSel properties.
 
Private Sub cmdList_Click()
    ' Set start_row to the smaller of MSFlexGrid1.Row
    ' and MSFlexGrid1.Row. Make stop_row the larger.
    If MSFlexGrid1.Row > MSFlexGrid1.RowSel Then
        start_row = MSFlexGrid1.RowSel
        stop_row = MSFlexGrid1.Row
    Else
        start_row = MSFlexGrid1.Row
        stop_row = MSFlexGrid1.RowSel
    End If

    ' Loop through the selected rows.
    For i = start_row To stop_row
        txt = txt & MSFlexGrid1.TextMatrix(i, 0) & ": " & _
            MSFlexGrid1.TextMatrix(i, 1) & vbCrLf
    Next i

    MsgBox txt
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated