Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Private Sub Form_Load()
Dim i As Integer
' Initialize MSFlexGrid
With MSFlexGrid1
.Rows = 6 ' How many rows
.Cols = 4 ' Set number of columns
.FixedRows = 1 ' One fixed header row
.FixedCols = 0 ' No fixed columns
' Set column headers
.TextMatrix(0, 0) = "ID"
.TextMatrix(0, 1) = "Name"
.TextMatrix(0, 2) = "Age"
.TextMatrix(0, 3) = "City"
' Set column widths
.ColWidth(0) = 1000
.ColWidth(1) = 2000
.ColWidth(2) = 1000
.ColWidth(3) = 2000
' Add sample data
For i = 1 To 5
.TextMatrix(i, 0) = CStr(i)
.TextMatrix(i, 1) = "Person " & CStr(i)
.TextMatrix(i, 2) = CStr(20 + i * 5)
.TextMatrix(i, 3) = Choose(i, "New York", "London", "Paris", "Tokyo", "Sydney")
Next i
' up to you
.BackColorSel = vbBlue
.ForeColorSel = vbWhite
.FocusRect = flexFocusNone ' Disable default focus rectangle
.SelectionMode = flexSelectionByRow ' click selects entire row
.HighLight = flexHighlightAlways ' Keep highlight even when grid loses focus
' Select the first data row
.Row = 1
.ColSel = .Cols - 1
End With
End Sub