作者:手机用户2502921201 | 来源:互联网 | 2023-10-11 16:51
IamusingaUserForminExceltomovecontentfromtextbox1tofirstemptyrowonsheet2.Belowc
I am using a UserForm in Excel to move content from textbox 1 to first empty row on sheet 2. Below command works fine but I would like to consider an empty row only if the first three columns are empty, not all columns (the others columns have some information).
我在Excel中使用UserForm将内容从文本框1移动到工作表2上的第一个空行。下面的命令工作正常,但我想只考虑前三列是空的,而不是所有列(其他列)的空行有一些信息)。
How can I adjust it?
我该怎么调整呢?
Private Sub CommandButton1_Click()
Dim emptyRow As Long
'Make Sheet2 active
With Sheets("Sheet2")
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(.Range("A:A")) + 1
'Transfer information
.Cells(emptyRow, 1).Value = TextBox1.Value
5 个解决方案