K
ken
G'day there One & All,
I've got a worksheet with a rectangular, contiguous range. The range
has dates as headings across the top, with offices down the left hand
column.
Once a week, each office posts their data and it's collected by my
workbook to be stored on the sheet according to date & office.
I'm trying to write a reporting sheet and found that I need to
determine the date when last reports were made. The data may include
blanks, so my idea of using dynamic ranges fell over. Also there is
other stuff to the right of my range, so using .end(xltoright) won't
work either.
The chances of all offices having zero entries is so low as to be
discounted, so what I want to do is to find which is the latest date
entered by any office. Having found the rightmost used column, I can
determine the date but I've had no success finding that column.
I've tried a few unsuccessful ideas of my own, and also tried to adapt
an Array Formula I found on Chip Pearson's site:
=INDIRECT(ADDRESS(MAX((B5:AA5<>"")*ROW(B5:AA5)),COLUMN(B5:AA5),4))
I thought that if I had one of these at the end of each row, and then
found the max value I might get the column number for my date. However I
only got '0' as a result, so I must have gotten something wrong.
If anyone has any ideas as to how I can work this out please come
forth. I'll be most grateful. BTW, I don't mind if I need a UDF in code.
There's plenty of code already, one more function won't hurt
Thanks for listening,
Ken
I've got a worksheet with a rectangular, contiguous range. The range
has dates as headings across the top, with offices down the left hand
column.
Once a week, each office posts their data and it's collected by my
workbook to be stored on the sheet according to date & office.
I'm trying to write a reporting sheet and found that I need to
determine the date when last reports were made. The data may include
blanks, so my idea of using dynamic ranges fell over. Also there is
other stuff to the right of my range, so using .end(xltoright) won't
work either.
The chances of all offices having zero entries is so low as to be
discounted, so what I want to do is to find which is the latest date
entered by any office. Having found the rightmost used column, I can
determine the date but I've had no success finding that column.
I've tried a few unsuccessful ideas of my own, and also tried to adapt
an Array Formula I found on Chip Pearson's site:
=INDIRECT(ADDRESS(MAX((B5:AA5<>"")*ROW(B5:AA5)),COLUMN(B5:AA5),4))
I thought that if I had one of these at the end of each row, and then
found the max value I might get the column number for my date. However I
only got '0' as a result, so I must have gotten something wrong.
If anyone has any ideas as to how I can work this out please come
forth. I'll be most grateful. BTW, I don't mind if I need a UDF in code.
There's plenty of code already, one more function won't hurt
Thanks for listening,
Ken