Hi
try this
Code:
Option Explicit
Sub kTest()
Dim t, r As Long
t = Evaluate("MATCH('Entry '!E4,DataStore!A1:A10000,0)")
r = Sheet2.Range("a1").CurrentRegion.Rows.Count
If IsError(t) Then
Sheet2.Range("a" & r + 1).Resize(, 13) = Application.Transpose(Sheet1.Range("e4:e16").Value)
Sheet2.Range("n" & r + 1).Resize(, 5) = Sheet1.Range("e19:i19").Value
Else
If MsgBox("Entry already exists for date '" & Format(Range("'Entry '!e4").Value, "dd-mmm-yy") & "'" & vbLf & _
"Do you want to overwrite the entry?", vbYesNo) = vbYes Then
Sheet2.Range("a" & t).Resize(, 13) = Application.Transpose(Sheet1.Range("e4:e16").Value)
Sheet2.Range("n" & t).Resize(, 5) = Sheet1.Range("e19:i19").Value
End If
End If
End Sub
Bookmarks