VBA中 Dim intRow As Integer和Dim strXh As String是什么意思?急!
具体代码如下:Subadd()DimintRowAsIntegerDimstrXhAsStringSheets("供方名录").ActivateIfstrStatus="...
具体代码如下:
Sub add()
Dim intRow As Integer
Dim strXh As String
Sheets("供方名录").Activate
If strStatus = "查询" Then
intRow = intCurrentRow
Else
Sheets("供方名录").Range("A8").Select
'获取员工花名册已有数据行数
intRow = ActiveCell.CurrentRegion.Rows.Count
strXh = Cells(intRow, 1) '取得最后编号
'按规则产生新的编号
strXh = "J" & Format(Right(strXh, 3) + 1, "000")
strXh = "J" & Format(Right(strXh, 4) + 1, "000")
'strXh = "J" & UserForm(Right(strXh, 3) + 1, "000")
'strXh = "J" & UserForm(Right(strXh, 4) + 1, "000")
intRow = intRow + 1
'将用户窗体上的数据填充到“供方名录”的新行上
Cells(intRow, 1) = strXh
End If 展开
Sub add()
Dim intRow As Integer
Dim strXh As String
Sheets("供方名录").Activate
If strStatus = "查询" Then
intRow = intCurrentRow
Else
Sheets("供方名录").Range("A8").Select
'获取员工花名册已有数据行数
intRow = ActiveCell.CurrentRegion.Rows.Count
strXh = Cells(intRow, 1) '取得最后编号
'按规则产生新的编号
strXh = "J" & Format(Right(strXh, 3) + 1, "000")
strXh = "J" & Format(Right(strXh, 4) + 1, "000")
'strXh = "J" & UserForm(Right(strXh, 3) + 1, "000")
'strXh = "J" & UserForm(Right(strXh, 4) + 1, "000")
intRow = intRow + 1
'将用户窗体上的数据填充到“供方名录”的新行上
Cells(intRow, 1) = strXh
End If 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询