0
關閉用戶窗體時出現錯誤(對象變量或未設置塊變量)提示。vba userform運行時錯誤91對象變量或未設置塊變量
Private Sub UserForm_Initialize()
TextboxTotal.Text = Worksheets("Data_Base").Range("F2")
expence.Show
End Sub
Private Sub CommandButton1_Click()
Dim blankrow As Integer
Dim ws As Worksheet
Set ws = Worksheets("Data_Base")
blankrow = Sheets("Data_Base").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Data_Base").Cells(blankrow, 1) = Format(TextDate.Value, "mm/dd/yyyy")
Sheets("Data_Base").Cells(blankrow, 2) = ComboBox1
Sheets("Data_Base").Cells(blankrow, 3) = Format(TextPrice.Value, "General number")
TextboxTotal.Text = Worksheets("Data_Base").Range("F2")
TextDate.Value = ""
ComboBox1.Value = ""
TextPrice.Value = ""
End Sub
什麼都行,你讓你的錯誤?你能介入F8嗎? –
另外,忘記詢問用戶表單名稱是否已經存在?如果是這樣,則不需要在'UserForm_Initialize'中添加'expense.show',而是在另一個調用此例程的例程中。 –