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.
Private Sub CommandButton1_Click()
Dim i As Integer
With Me.ListBox1
If .ListIndex = -1 Then Exit Sub
For i = 0 To .ColumnCount - 1
ActiveCell.Offset(0, i).Value = .List(.ListIndex, i)
Next i
End With
End Sub
Private Sub CommandButton2_Click()
Dim i As Integer
With Me.ListBox1
If .ListIndex = -1 Then Exit Sub
'Insert a row above the active cell
ActiveCell.EntireRow.Insert
For i = 0 To .ColumnCount - 1
'Report selection in the new row above the active cell
ActiveCell.Offset(-1, i).Value = .List(.ListIndex, i)
Next i
End With
End Sub
For i = 0 To .ColumnCount - 1
'Check to see whether to insert a formula or the column contents:
Select Case i
Case 3 'You've reached column D
'Enter formula for column D here: this uses A1 notation for the cell addresses
ActiveCell.Offset(-1, i).Formula
'Enter formula for column D here: this uses R1C1 notation for the cell adresses
ActiveCell.Offset(-1, i).FormulaR1C1
Case 4 'Column E
'Same as for Case 3
Case Else
'Use listbox column selection
ActiveCell.Offset(-1, i).Value = .List(.ListIndex, i)
Next i
DataRow = .ListIndex
DataRow = .ListIndex + 1