Md. Abdul Kader

About author

MD. ABDUL KADER is an engineer with a talent for Excel and a passion for VBA programming. To him, programming is like a time-saving wizard, making data manipulation, file handling, and internet interactions a breeze. His skill set extends to SWM, GIS, RS, and SPSS. He holds a B.Sc in Urban & Regional Planning from Chittagong University of Engineering and Technology and has shifted to become a content developer. In this role, he crafts technical content centred around Excel and VBA. Outside the professional realm, catch him immersed in books, exploring new places during travels, and watching movies.

Designation

Team Leader at ExcelDemy in SOFTEKO.

Lives in

Dhaka, Bangladesh.

Education

B.Sc in Urban & Regional Planning, Chittagong University of Engineering and Technology

Expertise

SWM, GIS, RS, SPSS, MS Excel, PowerQuery, PowerPivot & VBA

Experience

  • Technical Content Writing
  • Team Management

Summary

  • Currently working as Team Leader of ExcelDemy.
  • He started writing technical content for Excel & VBA for ExcelDemy in 2021.

Latest Posts From Md. Abdul Kader

1
How to Insert a Clustered Column Chart in Excel – 4 Methods

Method 1 - Create a Clustered Column Chart for Region-Wise Quarterly Sales data This is the sample dataset. Step 1: Inserting a Clustered Column ...

0
How to AutoFill from a List in Excel (8 Ways)

This is today’s dataset where the Employee Name is given with their ID No. However, other fields, such as Joining Month, Joining Date, and Salary, have only ...

0
How to Sort a Unique List in Excel – 10 Methods

The sample dataset showcases Employee Name, ID No., Salary & Rank.   Method 1 - Getting a Sorted Unique List 1.1. Using the Advanced ...

0
How to Remove a Header in Excel – 4 Methods

The header in the sample dataset is Product Order Records. Method 1 - Using the Page Setup to Remove a Header in Excel Go to Page Layout > ...

0
How to Filter Excel Pivot Table (8 Effective Ways)

This is our dataset where the Product Category is given with an Order Date, Quantity, and Sales based on the States of the U.S. We created a Pivot Table ...

0
How to Use VBA IsEmpty Function (5 Relevant Examples)

When you need to check whether a cell remains empty/blank or not. In such circumstances, you may utilize the VBA IsEmpty function to identify the emptiness. In ...

0
How to Use VBA TimeValue Function (6 Relevant Examples)

Often, we may have a time string in a format where the time value is not separate. In such a situation, using the VBA TimeValue function will be a better ...

0
How to Use VBA InStrRev Function (7 Suitable Examples)

When you need to find the position of a character inside a string or the occurrence of a substring inside a string, the VBA InStrRev function might be the best ...

0
Pivot Table Not Refreshing (5 Issues & Solutions)

We have a dataset where the Product Category, Quantity, and Sales are given based on states. You can visit the How to create a Pivot Table article to ...

0
How to Update Pivot Table Range (5 Methods)

The sample dataset contains the Product Category, Quantity and Sales per State.     The dataset is configured as a Pivot Table. ...

0
How to List Sheet Name in Excel (5 Methods + VBA)

In this article, we'll discuss various ways to derive a list of sheet names in Excel. Unfortunately, there is no dedicated function to fetch a list of sheet ...

0
How to Lookup Text in Excel (7 Methods)

Below is a dataset where employee names are provided with their Employee ID No and Email ID. Method 1 – Applying the LOOKUP Function to Extract Text ...

0
Excel Drop Down List Not Working (8 Issues and Solutions)

We'll provide you with 8 solutions in case your drop down list function is not working. Let’s consider the following dataset where some items are given with ...

0
Absolute Cell Reference Shortcut in Excel – 4 Examples

This is an the overview. Shortcut Cell Reference Description Press F4 Single Cell or Cell Range Changes neither the column nor the row. ...

0
How to Use the Excel Cell Format Formula (4 Methods)

What is Cell Formatting in Excel? Cell formatting involves adjusting or changing the appearance of a cell without altering its original value. In this ...

Browsing All Comments By: Md. Abdul Kader
  1. Hello EAC,
    Thanks for your question. Most likely, you need to put a not equal sign (<>) inside the If…Then statement of your second code. So, the corrected second code will be as follows-

    Sub block()
    Dim hz As String
    Dim hz1 As String
    
    hz = InputBox("enter your password")
    hz1 = InputBox("repeat password")
    
    If hz <> hz1 Then
    MsgBox "The repeated password is not identical!", vbExclamation
    hz = ""
    hz1 = ""
    Else
    Columns("D:F").Select
    Selection.Locked = False
    Range("D8:F12").Select
    Selection.Locked = True
    Range("a1").Select
    ActiveSheet.Protect hz
    End If
    End Sub

    However, your used three codes are quite messy. I would like to suggest that you can use the following code to lock a specific cell range in all worksheets of your Excel file.

    Sub Lock_CellRange_AllSheets()
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
            ws.Unprotect Password:="1234" 'Replace the password if you want
            ws.Range("D8:F12").Locked = True 'Replace the cell range
            ws.Protect Password:="1234", UserInterfaceOnly:=True 'Replace the password with the actual password for the workbook if it is protected
        Next ws
    End Sub

    Again, try this code to unlock the specific cell range in all worksheets.

    Sub Unlock_CellRange_AllSheets()
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
            ws.Unprotect Password:="1234" 'Replace the password if you want
            ws.Range("D8:F12").Locked = False 'Replace the cell range
            ws.Protect Password:="1234", UserInterfaceOnly:=True 'Replace the password with the actual password for the workbook if it is protected
        Next ws
    End Sub

    I hope these will work! Moreover, you can follow lock and unlock cells using VBA to explore more efficient methods.

  2. Hello Michael,
    Please specify your problem in detail or send the excel file via [email protected] email address.

  3. Dear Deka,
    It’s nice to hear from you with such wonderful appreciation. I myself always try to represent Excel applications in a more user-friendly way. And we, the ExcelDemy team, are working as a one-stop Excel solution provider.
    Thanks, and take care of yourself. Goodbye!
    Md. Abdul Kader
    Editor, ExcelDemy.

Close the CTA

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo