- 帖子
- 835
- 主題
- 6
- 精華
- 0
- 積分
- 915
- 點名
- 0
- 作業系統
- Win 10,7
- 軟體版本
- 2019,2013,2003
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2010-5-3
- 最後登錄
- 2024-11-14
|
8#
發表於 2013-8-7 22:20
| 只看該作者
回復 8# sppk22 - Sub SetStart()
- Dim lRows As Long, lRow As Long
- Dim iI%
-
- lRows = Cells(Rows.Count, 1).End(xlUp).Row
-
- For lRow = 3 To lRows
- With Cells(lRow, 1)
- Select Case .Offset(, 5)
- Case "同"
- If Left(.Value, 1) <> "*" Then
- .Value = "*" & .Value
- .Offset(, 3) = .Offset(, 4) * 1.1
- End If
- Case "出"
- If Right(.Value, 1) <> "*" Then .Value = .Value & "*"
- End Select
- End With
- Next lRow
- End Sub
複製代碼- Sub ClrStart()
- Dim lRows As Long, lRow As Long
- Dim iI%
-
- lRows = Cells(Rows.Count, 1).End(xlUp).Row
-
- For lRow = 3 To lRows
- With Cells(lRow, 1)
- If Left(.Value, 1) = "*" Then
- .Value = Mid(.Value, 2)
- .Offset(, 3) = ""
- .Offset(, 5) = "" ' 若不想清除 "出" 與 "同" 則刪除此行
- ElseIf Right(.Value, 1) = "*" Then
- .Value = Left(.Value, Len(.Value) - 1)
- End If
- End With
- Next lRow
- End Sub
複製代碼 |
|