- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 150
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2025-6-22
               
|
2#
發表於 2013-4-2 11:11
| 只看該作者
本帖最後由 Hsieh 於 2013-4-2 11:15 編輯
回復 1# a703130 - Sub nn()
- restr = InputBox("輸入關鍵字串", , "NG")
- With ActiveSheet
- For i = 6 To 10
- a = .Range(.Cells(1, i), .Cells(.Rows.Count, i).End(xlUp))
- mystr = Join(Application.Transpose(a), "")
- x = x + (Len(mystr) - Len(Replace(mystr, restr, ""))) / 2
- MsgBox "第" & i & "欄" & (Len(mystr) - Len(Replace(mystr, restr, ""))) / Len(restr) & "個" & restr
- Next
- MsgBox "總計有" & x & "個" & restr
- End With
- End Sub
複製代碼 |
|