Hi I am wondering how to use .address to determine on what row should I stop in my iteration. So my code is finding the cell address of a predetermined row of dates (weekly) and when I input a date, it will automatically look for the match/closest one. My problem is to put a value to the next column of the row of dates depending on the column on which the closest/match dates is in.
z = CDate(x)
MsgBox z
For Each find In Sheet2.Range("B4:B183")
If find = z Then
MsgBox "found at :" & find.Address
Do Until Sheet2.Range("C" & PaidRow) > find.Address
Sheet2.Range("C" & PaidRow).Value = 0
Loop
End If
Next
This is the part of the code where I should determine the address of the closest/match date.
First is I converted the x value which is my closest/match date to actual date and not excel values e.g. 44506 = 11/6/2021 and then the for loop is for me to determine the find.address which is correct when I put a msgbox find.address.
But I can't seem to use find.address outside the original for loop.