Hi
I try running the form , but shows error can't find project to library in this word
for this line
this is code
how fix this error please?
I try running the form , but shows error can't find project to library in this word
VBA Code:
newButton
VBA Code:
Set newButton = Me.Controls.Add("Forms.CommandButton.1", , True)
VBA Code:
Private Sub UserForm_Initialize()
Dim lastRow As Long
lastRow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
Dim i As Integer
For i = 1 To lastRow
Set newButton = Me.Controls.Add("Forms.CommandButton.1", , True)
With newButton
.Caption = Sheets("Sheet1").Cells(i, 2).Value
.Left = 10
.Top = 20 + (i - 1) * 30
End With
Next i
End Sub