'試試看:
'但 MsgBox 字數有限制, 一次不能裝太多!!
'能裝多少我不清楚!!
'如果裝不下, 就要分段顯示.
Private Sub Workbook_Open()
Dim xT As String
With Sheet1
For i = 2 To .UsedRange.Rows.Count + 1
If .Cells(i, 8) = "PENDING" Then
If ("0" < .Cells(i, 7)) And (.Cells(i, 7) < "4") Then
xT = xT & (.Cells(i, 3) & " Still have" & .Cells(i, 7) & "days!!! PLEASE UPDATE. ") & Chr(10)
ElseIf ((.Cells(i, 7)) < "1") Then
xT = xT & (.Cells(i, 3) & " Still not arrive!!!!! PLEASE FOLLOW UP. ") & Chr(10)
End If
End If
Next i
MsgBox xT
End With
End Sub作者: 准提部林 時間: 2016-3-17 14:11
這是根據准大的建議所做的修正:
試試看:
Private Sub Workbook_Open()
Dim I As Integer
With Sheet1
For I = 2 To .UsedRange.Rows.Count + 1
If .Cells(I, 8) = "PENDING" Then
If ("0" < .Cells(I, 7)) And (.Cells(I, 7) < "4") Then
.Cells(I, 3).Interior.ColorIndex = 36
ElseIf ((.Cells(I, 7)) < "1") Then
.Cells(I, 3).Interior.ColorIndex = 38
End If
End If
Next I
End With
End Sub作者: jeffrylky 時間: 2016-3-17 15:30