- 帖子
- 472
- 主題
- 5
- 精華
- 0
- 積分
- 485
- 點名
- 0
- 作業系統
- Windows
- 軟體版本
- MS Office
- 閱讀權限
- 100
- 性別
- 男
- 來自
- 香港
- 註冊時間
- 2010-7-4
- 最後登錄
- 2014-12-28

|
6#
發表於 2010-7-22 21:47
| 只看該作者
回復 kimbal
先謝謝前輩熱心指導,我直接把檔案丟上來好了!
wiemanson 發表於 2010-7-22 21:16 
正如上面所說,沒有 "去氫", 所以死掉啦~
貼上這個再試試運一下- Sub s1()
-
- Worksheets("Sheet1").Select
- x = 1
- Do
- If Cells(x, 1) = "" Then
- Exit Do
- End If
- Set y1 = Cells.Find(What:="三群", After:=ActiveCell)
- If y1 Is Nothing Then
- y1 = ""
- End If
- Set y2 = Cells.Find(What:="去氫", After:=ActiveCell)
- If y2 Is Nothing Then
- y2 = ""
- End If
- Set y3 = Cells.Find(What:="金發", After:=ActiveCell)
- If y3 Is Nothing Then
- y3 = ""
- End If
- Set y4 = Cells.Find(What:="厚", After:=ActiveCell)
- If y4 Is Nothing Then
- y4 = ""
- End If
- If Cells(x, 1) = y1 And Cells(x, 3) = y2 And Cells(x, 4) = "鎳" And Cells(x, 6) = "否" Then
- Cells(x, 7) = 11 * Cells(x, 5)
- ElseIf Cells(x, 1) = y1 And Cells(x, 3) = y4 And Cells(x, 4) = "鎳" And Cells(x, 6) = "否" Then
- Cells(x, 7) = 2 * Cells(x, 5)
- ElseIf Cells(x, 1) = y1 And Cells(x, 4) = "鎳" And Cells(x, 6) = "否" Then
- Cells(x, 7) = 5 * Cells(x, 5)
- ElseIf Cells(x, 1) = y1 And Cells(x, 4) = "鉻" And Cells(x, 6) = "否" Then
- Cells(x, 7) = 45 * Cells(x, 5)
- ElseIf Cells(x, 1) = y1 And Cells(x, 4) = "青銅" And Cells(x, 6) = "否" Then
- Cells(x, 7) = 12 * Cells(x, 5)
- ElseIf Cells(x, 1) = y1 And Cells(x, 4) = "鎳" And Cells(x, 5) <= 20 And Cells(x, 6) = "否" Then
- Cells(x, 7) = "斟酌"
- ElseIf Cells(x, 1) = y1 And Cells(x, 6) = "否" And Cells(x, 4) = "其它" Then
- Cells(x, 7) = "另外算"
-
-
- ElseIf Cells(x, 1) = y3 And Cells(x, 3) = Cells.Find(What:="(3mm)", After:=ActiveCell) And Cells(x, 4) = "鎳" And Cells(x, 6) = "否" Then
- Cells(x, 7) = "小支"
- ElseIf Cells(x, 1) = y3 And Cells(x, 4) = "鎳" And Cells(x, 6) = "否" Then
- Cells(x, 7) = 10 * Cells(x, 5)
- ElseIf Cells(x, 1) = y3 And Cells(x, 4) = "鉻" And Cells(x, 6) = "否" Then
- Cells(x, 7) = 2 * Cells(x, 5)
- ElseIf Cells(x, 1) = y3 And Cells(x, 4) = "鎳" And Cells(x, 5) <= 20 And Cells(x, 6) = "否" Then
- Cells(x, 7) = 40
- ElseIf Cells(x, 1) = y3 And Cells(x, 6) = "否" And Cells(x, 4) = "其它" Then
- Cells(x, 7) = "另外算"
-
- Else
-
- Cells(x, 7) = 0
-
-
- End If
-
-
-
- x = x + 1
- Loop
-
- End Sub
複製代碼 |
|