excel VBA 1004錯誤 應用程式或物件定義上錯誤 哪裡錯?

2017-07-27 8:29 am
Private Sub CommandButton1_Click()
1.Ranger("A2").End(xIDown).Row+1
Cells(r, "A") = TextBox1.Text
Cells(r, "B") = TextBox2.Text
Cells(r, "C") = TextBox3.Text
Cells(r, "D") = TextBox4.Text
Cells(r, "E") = TextBox5.Text
Cells(r, "F") = TextBox6.Text
Cells(r, "G") = TextBox7.Text
Cells(r, "H") = TextBox8.Text
Cells(r, "I") = TextBox9.Text
End Sub

回答 (2)

2017-07-31 8:10 pm
這是做什麼
1.Ranger("A2").End(xIDown).Row+1

r怎來

Ranger>>Range

r = [A2].End(xlDown).Row + 1

Private Sub CommandButton1_Click()
r = [A2].End(xlDown).Row + 1

For i = 1 To 9

Cells(r, i) = Controls("TextBox" & i).Text
Next
End Sub
2017-07-27 3:50 pm
XLDOWN 不是XIDOWN
CELLS(r,"A"), "A"是文字不是變數


收錄日期: 2021-05-03 06:47:50
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20170727002924AA2PF7R

檢視 Wayback Machine 備份