Sub TEST()
If Val([U3]) <= 0 Then Exit Sub
With [D1:S1].Offset([U3], 0)
If Application.CountA(.Cells) > 0 Then
If MsgBox("指定日期已有資料,是否更新數據? ", 0 + 4 + 256) = vbNo Then Exit Sub
End If
.Formula = "=IF(ISNA(MATCH(D$1,$A:$A,)),"""",VLOOKUP(D$1,$A:$B,2,))"
.Value = .Value
End With
End Sub作者: doulioufire 時間: 2015-9-8 12:50