一些幫助,請 - 努力保持簡單更新ActiveRow Excel VBA中
我有一個用戶窗體這在組合框更新文本框從選擇。我希望能夠改變這些填充盒,然後用Update命令,改變工作表中的值,然後清除表單
我已經能夠創建添加數據的用戶窗體,但我努力讓VBA從控制框中選擇活動單元格和活動行...... ????
一旦我能得到VBA正確AvtiveCell,我可以使用偏移和變化/根據需要添加
Private Sub ComboBox1_Change()
With Me
.TextBox1.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 2)
.TextBox2.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 3)
.TextBox3.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 4)
.TextBox4.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 5)
.TextBox5.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 6)
.TextBox6.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 7)
.TextBox7.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 8)
.TextBox8.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 9)
.TextBox9.Value = Sheet1.Cells(.ComboBox1.ListIndex + 2, 10)
End With
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub EditAddButton_Click()
EditAdd
End Sub
Private Sub UserForm_Initialize()
TextBox1.SetFocus
End Sub
您可以粘貼您當前的用戶表單代碼嗎?我們需要看看你已經有多遠了。 –
嗨克里斯,繼承人的代碼sofar –