- 帖子
- 129
- 主題
- 25
- 精華
- 0
- 積分
- 159
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- office2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2011-12-24
- 最後登錄
- 2022-12-12
|
2#
發表於 2014-2-8 23:10
| 只看該作者
本帖最後由 iceandy6150 於 2014-2-8 23:11 編輯
回復 1# newlink
哈哈,我是菜鳥,寫了陽春版的
可是要怎麼讓程式能一直執行,我不會
如果設一個按鈕,每按一次,可以使用一次,只針對第二列
要怎麼隨時隨著表格輸入就馬上跳動,我不會,還要再修改
Sub ex()
Dim i
i = Sheets("工作表1").Cells(2, 1).Value
MsgBox (i)
If i = "" Then
Exit Sub
ElseIf i = "保內" Then
Sheets("工作表1").Cells(2, 2).Value = "--"
Sheets("工作表1").Cells(2, 3).Value = "--"
Sheets("工作表1").Cells(2, 4).Value = "--"
ElseIf i = "二修" Then
Sheets("工作表1").Cells(2, 2).Value = "--"
Sheets("工作表1").Cells(2, 3).Value = "--"
Sheets("工作表1").Cells(2, 4).Value = "--"
ElseIf i = "保外" Then
If Sheets("工作表1").Cells(2, 2).Value = "" Then
Sheets("工作表1").Cells(2, 2).Value = "填金額"
End If
If Sheets("工作表1").Cells(2, 2).Value <> "" Then
Sheets("工作表1").Cells(2, 3).Value = "=Today()"
End If
Else
If Sheets("工作表1").Cells(2, 2).Value = "" Then
Sheets("工作表1").Cells(2, 2).Value = "填金額"
End If
If Sheets("工作表1").Cells(2, 2).Value <> "" Then
Sheets("工作表1").Cells(2, 3).Value = "=Today()"
End If
End If
End Sub |
|