返回列表 上一主題 發帖

[發問] 執行程序的速度

本帖最後由 oobird 於 2010-10-14 20:42 編輯

Private Sub CommandButton1_Click()
Application.EnableEvents = False
With Sheets("加班")
With .Range("A65536").End(xlUp)
.Range("a2") = TextBox1.Text
.Range("b2") = TextBox2.Text
.Range("c2") = TextBox3.Text
.Range("d2") = TextBox4.Text
.Range("e2") = TextBox3.Text
.Range("f2") = TextBox6.Text
.Range("g2") = TextBox7.Text
.Range("h2") = TextBox8.Text
.Range("i2") = TextBox9.Text
.Range("j2") = TextBox10.Text
.Range("k2") = TextBox11.Text
.Range("l2") = TextBox12.Text
.Range("m2") = TextBox13.Text
End With
End With
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
Application.EnableEvents = True
End Sub
另外TextBox5.Text = Weekday(CDate(TextBox3.Text), vbMonday)

TOP

不會的,我試過了呀,你是因為觸發了自訂函數才慢的,加上那兩行就不會延遲了!

TOP

在你表單輸入的同時,加班總表的only函數就要開始運作,接著後面的sumproduct...都要重算。
跟本的辦法就是別用only函數,把它改成用Sub過程來執行。

TOP

        靜思自在 : 【時間如鑽石】時間對一個有智慧的人而言,就如鑽石般珍貴;但對愚人來說,卻像是一把泥土,一點價值也沒有。
返回列表 上一主題