Check for current date in a row

S

sd

I know this is simple but I cant get it right. I have a report that I
only want to update if the data is not already there. Right now if the
last row is the same as the date on the report things work well. But if
the report is run with a date that has already been run it adds this
data.
How do I check row a to see if the date is there?

Sub KeepRecords()

'Check sheet ("MTD").Range (A:A) If value is same as("REPORT"). range
("P1") date GoTo end sub.
'If value different add data from REPORT sheet.

Application.ScreenUpdating = False

Dim LastRow As Object
Set LastRow = Sheets("MTD").Range("A65536").End(xlUp)

If LastRow = Sheets("Report_Date").Range("D3") Then GoTo 1

Dim NextRow As Object
Set NextRow = Sheets("MTD").Range("A65536").End(xlUp)

With NextRow
.Offset(1, 0) = Sheets("Report").Range("P1")
.Offset(1, 1) = Sheets("Report").Range("C4")
.Offset(1, 2) = Sheets("Report").Range("C5")
.Offset(1, 3) = Sheets("Report").Range("C6")
.Offset(1, 4) = Sheets("Report").Range("G4")
.Offset(1, 5) = Sheets("Report").Range("G5")
.Offset(1, 6) = Sheets("Report").Range("G6")
.Offset(1, 7) = Sheets("Report").Range("G7")
.Offset(1, 8) = Sheets("Report").Range("I6")
End With
1
End Function
 
A

Ardus Petus

If Not Worksheets("MTD").Range("A:A").Find( _
What:=Worksheets("REPORT").Range("P1"), _
XlSearchOrder:=xlByColumns _
) Is Nothing Then Exit Sub

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top