|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Private Sub 创建_Click()
Dim x, y
y = 0
wk = Weekday(CmbYY.Value & "-" & CmbMM.Value & "-" & "1", 2)
ts = Day(DateSerial(CmbYY.Value, CmbMM.Value + 1, 0))
x = wk
For i = 1 To ts
m = wk Mod 7
Set AA = Controls.Add("Forms.CommandButton.1", i, True)
With AA
.Left = (x - 1) * 50 + 26
.Top = 90 + y * 30
.Width = 25
.Height = 20
.Caption = Format(i, "00")
.FontSize = 12
End With
If m = 0 Then
y = y + 1
x = 1
Else
y = y
x = x + 1
End If
wk = wk + 1
Next
End Sub
Private Sub 删除_Click()
For i = 1 To 10
i = Format(i, "00")
Controls.Remove ("CommandButton" & i) 报错:无效参数
Next
End Sub
|
|