Count Number Of Users Who Are Active In An Excel Workbook

In this code we will see how we can get the count of users active in a workbook; there may be a situation in which we need to get the count if active users in a shared workbook so basically we get the count of users who are connected to the workbook.

We will try to find number of users that are currently using the workbook.




Step 1

Open VB editor from Develop the workbook in which we will write the code to get the number of users currently using the workbook.

Open developer tab to write VBA to find total number of active users of a workbook

Step 2

Insert a module in which we will the VBA code.

Insert a module in the VB editor

Step 3

Now double click the newly created module to open that and paste the below code in the module.

Sub Get_No_Of_users()

    Users = ActiveWorkbook.UserStatus

    MsgBox “Total Users using the current WorkBook: ” & UBound(Users)

End Sub




code to get number of active users in a workbook

This code will display the number of users who are currently using the excel workbook in a message box, you can modify this to get the count of users using the workbook in a cell value.

result sowing the count of users in a workbook

Hope this helped.



Share The Knowledge

Random Posts