I think the logic is a little inconsistant compared to the message text but I'm not sure. I did not really follow which columns were being matched against which, so I used Const to define some columns and Dim-ed two WS variables to make it easier for me to read
I'd use .CurrentRegion instead of .UsedRange
I prefer to use .Cells(row, col) instead of constructing a Range(string). I find it easier to read (very personal opinion)
Not sure since there's no data, but if you find something during the inner loop, could you just exit to the next iteration on the outer loop?
You might make the variable names (currentRowS1 and currentRowS2) more self-documenting e.g. iDataRow and iDIDrow so that it's easier to follow ( very personal opinion #2)
Option Explicit
'I assume that Sheet1 Date in in Column T ??????????????????????????
'Sheet1 contains: Date (Column U), Extension (Column U), Number (Column V)
'DID Corrections sheet contains: Extension (Column A), Number (Column B), Date From (Column C) and Date To (Column D)
Const cDateCol As Long = 20
Const cExtCol As Long = 21
Const cNumberCol As Long = 22
Const cDIDExtCol As Long = 1
Const cDIDNumberCol As Long = 2
Const cDIDFromCol As Long = 3
Const cDIDToCol As Long = 4
Sub checkAndReplace()
Dim wsOne As Worksheet, wsDID As Worksheet
Dim currentRowS1 As Long, currentRowS2 As Long
'???? Range("U1:T" + CStr(wsOne.UsedRange.Count) + ",A1:A" + CStr(wsDID.UsedRange.Count)).Select
Set wsOne = ThisWorkbook.Worksheets("Sheet1")
Set wsDID = ThisWorkbook.Worksheets("DID Corrections")
For currentRowS1 = 2 To wsOne.Cells(1, cExtCol).CurrentRegion.Rows.Count
For currentRowS2 = 2 To wsDID.Cells(1, cDIDExtCol).CurrentRegion.Rows.Count
If wsOne.Cells(currentRowS1, cDateCol).Text = wsDID.Cells(currentRowS2, cDIDExtCol).Text Then
If DateDiff("d", wsOne.Cells(currentRowS1, cDateCol).Value, wsDID.Cells(currentRowS2, cDIDNumberCol).Value) <= 0 And _
DateDiff("d", wsOne.Cells(currentRowS1, cDateCol).Value, wsDID.Cells(currentRowS2, cDIDFromCol).Value) >= 0 Then
wsOne.Cells(currentRowS1, cNumberCol).Value = wsDID.Cells(currentRowS2, cDIDToCol).Value
End If
End If
Next
Next
End Sub