1) It need to be public function, which will be used to in different sub(), even in different modules.
2) In each sub(), I have the code to browse and open target workbook, then set WB as the opened workbook, then use the public function to figure out the maximum row number used in WB. For example, WB has three sheets, sheet 1 has 12 rows, sheet 2 has 48 rows, sheet 3 has 44 rows, then it should return 48. Number of rows used, I mean the ending row. For example, sheet 1 has 12 rows, it means the last row used is row #12, it doesn't matter if there are blank rows existing above row #12.
Thanks.
Bookmarks