返回列表 上一主題 發帖

一個資料輸問題

回復 1# hong912
試試看
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Rng As Range, AR(), R
  4.     With Workbooks("出貨單.xlsx").Sheets(1)
  5.         Set Rng = .Columns("D:D").Find("正確無誤", LookAT:=xlWhole)
  6.         If Not Rng Is Nothing Then
  7.             AR = .Range("C15:g" & Rng.Row - 1).Value
  8.         Else
  9.             MsgBox "沒有  正確無誤"
  10.             Exit Sub
  11.         End If
  12.     End With
  13.     With Workbooks("存檔.xlsx").Sheets(1)
  14.         With .Range("c" & .Rows.Count).End(xlUp).Offset(1)
  15.             .Resize(UBound(AR), UBound(AR, 2)) = AR
  16.             With .Offset(, -2).Resize(UBound(AR))
  17.                 .Cells = "=month(Today())"
  18.                 .Value = .Value
  19.             End With
  20.             With .Offset(, -1).Resize(UBound(AR))
  21.                 .Cells = "=today()"
  22.                 .Value = .Value
  23.             End With
  24.         End With
  25.     End With
  26. End Sub
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

        靜思自在 : 君子如水,隨方就圓,無處不自在。
返回列表 上一主題