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

0
How to Calculate the Running Total by Group Using the Excel Power Query – 2 Methods

The dataset showcases Items and Sales over three months. To calculate the running total by group (Month), choose a month:   Method 1 - Running ...

0
How to Link Picture to Cell Value in Excel: 4 Methods

The example dataset below shows the yearly Sales of various Products. The entire dataset is located in the B4:D13 cell range. Method 1 - Using the ...

0
How to Put Parentheses for Negative Numbers in Excel

The following sample dataset of Purchase Price and Selling Price are provided in USD for each Product. If you subtract the Selling Price from the Purchase ...

0
Excel VBA:  Create a UserForm Image from a Worksheet – 3 Examples

  Example 1 - Using the Copy Pasting Tool You have an image in your worksheet. To add this image to the UserForm dialog box:   Go to ...

0
How to Find and Replace within Selection in Excel (7 Methods)

Our sample dataset contains the sales report of some Items along with the relevant Sales Rep. Quantity, Unit Price, and Sales for each item are also provided. ...

0
How to Use Dynamic Range for Last Row with VBA in Excel (3 Methods)

Why Do You Need a Dynamic Range We have a simple dataset with Quantity, Unit Price, and Sales of some Items. We want to find the average, sum, maximum value, ...

0
VLOOKUP Date Range and Return Value in Excel: 4 Methods

Let’s introduce today’s dataset where the name of the Items is provided along with Order Dates, Unit Price, Quantity and Sales. Method 1 - VLOOKUP a ...

0
How to Change Date Format in Pivot Table in Excel

Let’s introduce today’s dataset where Sales of some Product Categories is provided along with an Order Date and corresponding States. Creating a Pivot ...

0
How to Count Unique Values in a Filtered Column in Excel (5 Methods)

Dataset Overview In our dataset, we have information on the Quantity and Sales of various Product Categories, along with Order Dates and corresponding States. ...

0
How to Convert Number to Text without Scientific Notation in Excel

In Excel, if you input a number with 15 or more digits, although the number is stored in number format as usual, it is displayed by default in scientific ...

0
How to Combine Cells into One with Line Break in Excel: 5 Methods

Method 1 - Using the Ampersand Operator and CHAR Function Assuming that you want to get combined information by merging two or more cells. The following ...

0
How to Add a Checkbox in Excel (2 Steps + 4 Uses)

Most likely you see a checkbox that is mainly used for selecting or deselecting any option. Though the process of adding a checkbox in Excel is quite easy, you ...

0
How to Lock Multiple Cells in Excel – 6 Methods

This is the sample dataset.   Method 1 - Using the Format Cells Option Step 1 - Removing the Default "Locked" Option  Place the cursor ...

1
How to Use FormulaR1C1 Absolute Reference in Excel VBA

While working in Excel, you might hear the absolute cell reference. This type of cell reference remains unchanged if you copy, move or even use it in an array. ...

1
How to Apply Conditional Formatting in Excel If Another Cell Is Blank: 5 Methods

In the dataset below, the Sales Report for January is provided, and some cells are blank. Method 1 – Using a Simple Formula Steps: Select ...

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