- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
2#
發表於 2015-10-2 17:25
| 只看該作者
回復 1# hong912
試試看- Option Explicit
- Sub Ex()
- Dim Rng As Range, AR(), R
- With Workbooks("出貨單.xlsx").Sheets(1)
- Set Rng = .Columns("D:D").Find("正確無誤", LookAT:=xlWhole)
- If Not Rng Is Nothing Then
- AR = .Range("C15:g" & Rng.Row - 1).Value
- Else
- MsgBox "沒有 正確無誤"
- Exit Sub
- End If
- End With
- With Workbooks("存檔.xlsx").Sheets(1)
- With .Range("c" & .Rows.Count).End(xlUp).Offset(1)
- .Resize(UBound(AR), UBound(AR, 2)) = AR
- With .Offset(, -2).Resize(UBound(AR))
- .Cells = "=month(Today())"
- .Value = .Value
- End With
- With .Offset(, -1).Resize(UBound(AR))
- .Cells = "=today()"
- .Value = .Value
- End With
- End With
- End With
- End Sub
複製代碼 |
|