【发布时间】:2016-01-19 16:59:57
【问题描述】:
如何让 b 列在周末显示“无”?代码运行,但我没有看到与没有选择案例的情况有什么不同。
Sub fixandresponse()
Dim count As Integer
Dim thedate As Date
Dim typesofproblems() As Variant
thedate = DateSerial(2014, 9, 1)
typesofproblems = Array("bought new hardware", "Phone Support", "New User Request", "Rent Hardware")
Select Case WeekdayName(thedate)
Case 1, 7: Instr(typesofproblems) = "none"
For count = 2 To 366
Range("B" & count) = typesofproblems(WorksheetFunction.RandBetween(0, 3))
Range("A" & count) = thedate
thedate = thedate + 1
Next
End Select
End Sub
【问题讨论】:
-
如果我删除它运行的选择案例,它就不起作用。但我希望它在周末不说,我不知道怎么做。
-
现在还说无效的过程调用