ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Datagrid ActiveX Control (https://www.excelbanter.com/excel-programming/273776-datagrid-activex-control.html)

MK[_2_]

Datagrid ActiveX Control
 
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

patrick molloy

Datagrid ActiveX Control
 
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

-----Original Message-----
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
.


No Name

Datagrid ActiveX Control
 
Can the flexgrid be used to accept input that the user
actually types into the grid?
Thanks,
Mike
-----Original Message-----
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

-----Original Message-----
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
.

.


Keith Willshaw

Datagrid ActiveX Control
 
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


wrote in message
...
Can the flexgrid be used to accept input that the user
actually types into the grid?
Thanks,
Mike
-----Original Message-----
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

-----Original Message-----
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
.

.





All times are GMT +1. The time now is 07:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com