I would be happy with merely activating or selecting the cell/row that I want. How do I do that when that cell/row will move from month to month? How do I tell excel/vba, “Go to the last cell or row in tableofdata”?
I wonder if I can just Range(“A1”).End(xlDown).Select. Hang on…will go try…
:swear: grr…nope…it just sits there in the top row of my table.
oooh, but if I try Range(“b11”).End(xlDown).Select it works. It must need help getting past the title row.
Ohhhh…I get it…the reference in Range(“xx”) is an absolute reference within the sheet and not a relative reference within the selected range or table.
Well, if these Tables never start too many rows down the sheet and are always longer than, say, 10 rows, I should be able to get by with this clumsiness.
As we used to say in Intro to Pascal, “It may be shit, but it compiles!”
This may come a bit late, but I had the same problem and I fixed it like this.
I thought of the row number as a coordinate, therefore an integer.
If you store the table’s rows number in a variable, datatype int, then you can dinamically go to the last row even when you add new rows. You could use the databodyrange as you were saying.
Dim lrow As Integer
lrow = task.ListRows.Count
Worksheets("Worksheet name").ListObjects("Table name").DataBodyRange(lrow, 2)