a = Val(Sheet1,Cells(1,3).Value)这句哪错了啊Sub 产品入库()Dim a As LongDim b As IntegerSheets("商品入库以及查询").SelectIf Trim(Cells(7,1).Value) = "" ThenMsgBox "日期请勿留空",vbOKOnlyExit SubEnd Ifa = Val(Sheet1,Cells(1,3).V
来源:学生作业帮助网 编辑:作业帮 时间:2024/04/27 18:02:54
a = Val(Sheet1,Cells(1,3).Value)这句哪错了啊Sub 产品入库()Dim a As LongDim b As IntegerSheets("商品入库以及查询").SelectIf Trim(Cells(7,1).Value) = "" ThenMsgBox "日期请勿留空",vbOKOnlyExit SubEnd Ifa = Val(Sheet1,Cells(1,3).V
a = Val(Sheet1,Cells(1,3).Value)这句哪错了啊
Sub 产品入库()
Dim a As Long
Dim b As Integer
Sheets("商品入库以及查询").Select
If Trim(Cells(7,1).Value) = "" Then
MsgBox "日期请勿留空",vbOKOnly
Exit Sub
End If
a = Val(Sheet1,Cells(1,3).Value)
For b = 1 To 9
Cells(a + 11,b).Value = Cells(7,b).Value
Next b
End Sub
a = Val(Sheet1,Cells(1,3).Value)这句哪错了啊Sub 产品入库()Dim a As LongDim b As IntegerSheets("商品入库以及查询").SelectIf Trim(Cells(7,1).Value) = "" ThenMsgBox "日期请勿留空",vbOKOnlyExit SubEnd Ifa = Val(Sheet1,Cells(1,3).V
添加一个按钮,代码如下:
Private Sub CommandButton1_Click()
Cells.Select
Selection.EntireRow.Hidden = False
m = Val(Sheet1.Cells(1, 43).Value)
If Sheet1.Cells(1, m).Value = 0 Then
For i = 2 To Val(Sheet1.Cells(1, 44).Value)
If Sheet1.Cells(i, m).Value = "" And Sheet1.Cells(i - 1, m).Value = "" Then
Rows(i).EntireRow.Hidden = True
ElseIf Sheet1.Cells(i, m).Value = "" And Sheet1.Cells(i - 1, m).Value <> Sheet1.Cells(1, m).Value Then
Rows(i).EntireRow.Hidden = True
ElseIf Sheet1.Cells(i - 1, m).Value = "" And Sheet1.Cells(i, m).Value <> Sheet1.Cells(1, m).Value Then
End If
Next i
End If
For i = 2 To Val(Sheet1.Cells(1, 44).Value)
If Sheet1.Cells(1, m).Value <> Sheet1.Cells(i, m).Value And Sheet1.Cells(1, m).Value <> Sheet1.Cells(i - 1, m).Value Then
Rows(i).EntireRow.Hidden = True
End If
Next i
End Sub
OK!搞定!