0


I've been messing with VBA within an Excel module (as opposed to a sheet). I've been trying to select the last value in a table after importing data.
Below are two attempts at doing so:

1st Try:

Sheets("Awaiting Completion").Range("A" & rowno).Select

2nd Try

ActiveWorkbook.Sheets("Awaiting Completion").Range("A999").End(xlUp).Select

Both of these come back with:

"Run-time error '1004': Select method of Range class failed"

BigBen
  • 46,229
  • 7
  • 24
  • 40
veila
  • 83
  • 8
  • You `Activate` the sheet first. – BigBen Oct 27 '21 at 14:57
  • From the linked thread: "Even better is using references and trying to avoid using the Selection and Active* objects entirely" – BigBen Oct 27 '21 at 14:57
  • Also see how and why you should [avoid using Select](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba). – BigBen Oct 27 '21 at 14:58

0 Answers0