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 Sort by Date and Time in Excel (4 Useful Methods)

Sorting implies rearranging data to get a better visual presentation of your dataset. It is such a powerful tool that can organize text, numbers, and dates. In ...

0
How to Apply Multiple Filters in Excel (6 Suitable Methods)

Filtering becomes indispensable when you have a larger and more complicated dataset. Retrieving the desired data is quite time-consuming from such a dataset. ...

0
Dynamic Range for Multiple Columns with Excel OFFSET

The article will show you how to use OFFSET Dynamic Range for multiple columns in Excel in effective ways. Dynamic range expands automatically when you update ...

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

We frequently add up a series of numbers, but in certain cases, we may need to sum the last 5 values in a row in Excel. In this article, I’ll discuss the five ...

0
How to Compare Text in Two Columns in Excel

Comparing text in two columns in Excel is a significant task in our daily lives, especially when we have to find something that compares to the given text. In ...

0
Reference Operator in Excel [Basics + Special Uses]

It is highly unlikely that you'd be an Excel user without having heard of reference operators. We use these essential operators frequently. And this is the ...

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

When working with data sets that contain dates, you may need to sum the values based on the provided date regularly. SUMPRODUCT is one of the versatile ...

0
How to Find Lowest Value with Criteria in Excel (7 Effective Ways)

Finding the lowest value may be an essential task in some cases. We can easily do those tasks with the help of Microsoft Excel. Have you tried this basic ...

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

In some cases, we have to find the date after incrementing 1 month. Do you know the easiest ways and functions to do that? In this article, I’ll focus on how ...

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

You may attach a special type of number like 1 before the local phone number of the US to make it an international identity. It is also mentionable that the ...

0
How to Apply SUMIF with Multiple Ranges in Excel

The SUMIF function is widely used in Excel for calculating the sum value of a single range based on a given criterion. But it is also possible to apply SUMIF ...

0
Sum Values Based on Date in Excel (4 Ways)

While working with data sets that contain dates, you may have to sum the values based on the given date frequently. In this article, we’ll focus on the ways ...

0
Excel COUNTIF with Greater Than and Less Than Criteria

In this article, I’ll discuss how you’ll count cells greater than and less than using the function with 6 practical examples. First, I’ll focus on the basics ...

0
How to Round to Nearest 100 in Excel (6 Quickest Ways)

In certain circumstances, we prefer the rounded or approximate number rather than the exact number to make communication easier. For example, the exact ...

0
How to Split One Cell into Two in Excel (5 Useful Methods)

When you import data from a database or any other source, you have to split cell one into two or more in such situations. In this tutorial, I’m going to ...

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