+ Reply to Thread
Results 1 to 2 of 2

Public function for maximum rows used in a workbook?

  1. #1
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    Public function for maximum rows used in a workbook?

    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.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Public function for maximum rows used in a workbook?

    This seems to work:

    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Running Public Sub in one workbook to run another macro in another workbook
    By Andrewstupendo in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-26-2016, 05:40 PM
  2. Declaring something higher than public to work in another workbook?
    By lordterrin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2014, 02:54 PM
  3. Move all rows 1 down but skip row 26 & Public Function IF problem
    By prefix in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 01-28-2010, 03:19 AM
  4. #NAME Error with Function Defined with Public Function
    By Simon Austin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2009, 08:46 AM
  5. Workbook Share - Public Variables
    By Wizz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2008, 11:16 AM
  6. [SOLVED] Calling a Public Subroutine in a Different Workbook
    By Raul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2005, 12:05 AM
  7. [SOLVED] Workbook-level public variables
    By Stefi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-09-2005, 11:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1