That's OK if column A is the deepest. If some other column is the deepest/longest then it will over-write in those rows, no? I think I would use Find instead. Sample:
lRow = .Cells.Find(what:="*", After:=Range("I5"), LookAt:=xlPart, LookIn:=xlFormulas, _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False).row
If I'm not mistaken, using Find in code affects the application's Find parameters so it's best to specify most if not all of them each time. I might be confusing that with something else so I suggest reading up on the method.
Also, pretty sure one needs a reference to Excel library in order to use automation of Excel from within Access and I didn't see that mentioned.
EDIT - that is contained in a With block, which is why the reference starts with .Cells
Last edited by Micron; 02-04-2025 at 10:07 AM.
Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.