Datagrid ActiveX Control

  • Thread starter Thread starter MK
  • Start date Start date
M

MK

Does the Datagrid control work when used on Excel
UserForm? When I run my UserForm, the control is
displayed but I am unable to enter any data. All of the
microsoft docs I see only refer to VB use of the control,
not VBA.
Same question about the MOWC spreadsheet control.

Thanks for your help,
Mike
 
I have a flexgrid which I populate from a range thus:

Private Sub LoadFlex()

Dim rSource As Range
Set rSource = NamedRange(DATA_EXTRACT)
Dim index As Long 'loop counter
Dim rw As Long
With MSFlexGrid1

.Cols = rSource.Columns.count
.Rows = rSource.Rows.count
.Row = 0
For index = 0 To .Cols - 1
.col = index
.text = rSource.Cells(1, index + 1).Value
Next
For rw = 2 To rSource.Rows.count
.Row = rw - 1
For index = 0 To .Cols - 1
.col = index
.text = rSource.Cells(rw, index + 1).Value
Next index

Next rw

End With

End Sub


here, DATA_EXTRACT is a constant,"Data.Extract" which in
the workbook is a named range.

HTH
Patrick Molloy
Microsoft Excel MVP
 
Can the flexgrid be used to accept input that the user
actually types into the grid?
Thanks,
Mike
 
Not directly , you have to fake it by detecting the mouse down event at
the grid , superimposing a text box of the size of the active cell and use
the lost focus event to update the grid.

Keith
 
Back
Top