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 Use the ROW Function in Excel (8 Examples)

  Overview of the Excel ROW Function Description The ROW function returns the row number for a given reference. The reference may be a cell or ...

0
How to Use the NOT Function in Excel – 8 Examples

This is an overview:   The Excel NOT Function The NOT function reverses (opposite of) a Boolean or logical value. If you enter TRUE, the ...

0
How to Use TRUE Function in Excel (10 Ideal Examples)

The TRUE function has a special type of compatibility in returning results based on logical conditions. TRUE Function in Excel (Quick View) ...

0
How to Use WEEKDAY Function in Excel (with 8 Examples)

Excel WEEKDAY Function: Syntax & Arguments Syntax =WEEKDAY(serial_number, ) Return Values 0 to 7 (in numbers) Arguments ...

0
How to Use the MINUTE Function in Excel – 6 Examples

The Excel MINUTE Function Summary The MINUTE function returns the number of minutes in a given time value. For example, if the time value is “10:30 ...

0
How to Sort by Date and Time in Excel (4 Useful Methods)

  Let’s have a look at our sample dataset. Here, the Order ID of products is given along with their Delivery Date, Delivery Time, and Price. We’ll sort ...

0
How to Apply Multiple Filters in Excel: 6 Methods

Before going to the steps, consider the following dataset. Here, the Names of 15 Sites are given along with their Category. Furthermore, the Visits Number and ...

0
Dynamic Range for Multiple Columns with Excel OFFSET

A dynamic range expands automatically when you update the raw data in the range. In this article, we’ll discuss the ways to apply the OFFSET function in a ...

0
How to Sum Last 5 Values in a Row in Excel (5 Handy Approaches)

Download the Practice Workbook Finding Sum of Last 5 Values.xlsm 5 Simple Methods to Sum Last 5 Values in a Row in Excel We have a dataset that ...

0
How to Compare Text in Two Columns in Excel

For illustration, we will use following sample dataset containing two lists of items. Method 1 - Comparing Text in Two Columns For Matches in Rows ...

0
Excel SUMPRODUCT Function Based on Date Range (7 Examples)

  An Introduction to the SUMPRODUCT Function This section is mainly for beginners. It'll explain the SUMPRODUCT function and the process of entering the ...

0
How to Find the Lowest Value with Criteria in Excel – 7 Methods

This is the sample dataset.   Method 1 - Combine Excel MIN & IF Functions to Get the Lowest Value   1.1. Single Criteria To get ...

0
How to Increment Month by 1 in Excel (8 Handy Ways)

We have a dataset of dates in the cell range B5:B16. We will calculate the 1-month increment of the given dates. Method 1 - Use the AutoFill Option ...

0
How to Add a 1 in Front of Numbers in Excel (7 Methods)

Method 1 - Using Ampersand Operator The ampersand operator is used to combine or merge two or more cells in Excel. In this method, we will use this ...

0
How to Apply SUMIF with Multiple Ranges in Excel

In the sample dataset, we want to get the total price of Apples by adding the price in the January, February, March and Discount columns using the SUMIF ...

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.

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo