- 帖子
- 262
- 主題
- 8
- 精華
- 0
- 積分
- 280
- 點名
- 0
- 作業系統
- xp
- 軟體版本
- Office 2007
- 閱讀權限
- 20
- 性別
- 男
- 來自
- HK
- 註冊時間
- 2015-8-11
- 最後登錄
- 2025-3-24

|
2#
發表於 2020-9-14 10:49
| 只看該作者
- Sub zz()
- Dim c, a, Msg$, n&
- c = Array("Line", "JobNo", "Color", "Size", "PO")
- a = [a1:e1].Value
- For j = 1 To UBound(a, 2)
- If UCase(c(j - 1)) = UCase(a(1, j)) Then
- Msg = Msg & Chr(10) & j & " " & "Text compare passed"
- If Not c(j - 1) = a(1, j) Then
- Msg = Msg & " but Case not matched"
- Else
- Msg = Msg & " and Case macthed"
- n = n + 1
- End If
- Else
- Msg = Msg & Chr(10) & j & " " & "String compare failed"
- End If
- Next
- If n = UBound(a, 2) Then Msg = "!All Passed"
- If Len(Msg) > 0 Then Debug.Print Mid(Msg, 2)
- End Sub
複製代碼 |
|