Ads

Showing posts with label xls. Show all posts
Showing posts with label xls. Show all posts

How to count the number of worksheets used in an MS Excel file


Assuming I have a number of workbooks with a large number of worksheets filled out (not by me) in each workbook. Do you know how to count the number of worksheets used ?

Well you wouldn't be interested in manually counting by clicking each worksheet ?
Yes there is a way! A much easier than using the VB code;

Here we go;
We use Excel in built formula:

=COUNTA('*'!A1)+1

... where assuming A1 in each sheet is non-blank.

Example:

1. Suppose I have an xls file with 100 sheets:
2. I choose cell B2 and place my formula in it.







3. Press the followin gkeys: Ctrl+Shift+Enter

4. You get the answer as 100 in the cell B2

How to Lock Individual Cells in a Excel Worksheet (MS Office)


What happens when you lock cells in Excel Worksheet?
If you lock a cell and protect the worksheet, then you cannot type data into the cell, modify the data currently in the cell, or change other attributes of the cell (such as cell formatting).

This article describes how to lock individual cells in a Microsoft Excel worksheet. The procedure to use depends on whether you want the majority of the cells on the worksheet to remain locked or unlocked.


If You Want the Majority of Cells Locked
To lock the majority of the cells on the worksheet, follow these steps:

   1. Select the cells that you want to remain unprotected. To select nonadjacent (noncontiguous) cells, hold down CTRL and click the cells that are to remain unprotected.
   2. On the Format menu, click Cells, and then click the Protection tab.
   3. Click to clear the Locked check box and click OK.
   4. On the Tools menu, point to Protection, and then click Protect Sheet. Type a password if you want one, and then click OK.


Recover locked password here !!

If You Want the Majority of Cells Unlocked
To leave the majority of the cells on the worksheet unlocked, follow these steps:

   1. Select the entire worksheet by clicking the Select All button (the gray rectangle in the upper-left corner of the worksheet where the row 1 and column A headings meet), or by pressing CTRL+A or CTRL+SHIFT+SPACEBAR.
   2. On the Format menu, click Cells, and then click the Protection tab. Click to clear the Locked check box and click OK.
   3. Select the cells that you want to protect. To select nonadjacent (noncontiguous) cells, hold down CTRL and click the cells that you want to protect.
   4. On the Format menu, click Cells, and then click the Protection tab. Click to select the Locked check box, and then click OK.
   5. On the Tools menu, point to Protection, and then click Protect Sheet. Type a password, if you want one, and then click OK.

Source