I am trying to find the cell using the formula below but it errors out. The data is located on ws1
sheet and I have the run macro button on the Engine sheet. If I run the macro from the module while I have ws1
selected the macro runs without issue. If I run the macro using the button on the Engine sheet it errors out. I tried adding ws1.actiavte
above this line of code but it does not fix the issue.
FYI C7=4/1/2022
Set myr = ws1.Range("A:A").Find(ThisWorkbook.Sheets("Engine").Range("C7").Value, after:=ws1.Cells(1, 1), searchdirection:=xlNext)
Adding LookIn:=xlFormulas resolved the issue. The range.find of a date required LookIn:=xlFormulas in order to work it appears.
Set myr = ws1.Range("A:A").Find(ThisWorkbook.Sheets("Engine").Range("C7").Value, after:=ws1.Cells(1, 1), LookIn:=xlFormulas, _ LookAt:=xlPart, searchdirection:=xlNext)