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
[Fixed] Excel Print Error Not Enough Memory

You might receive the error message below when trying to print an Excel file (.xlsx or .xlsm). There are several possible reasons for this error, such as ...

0
How to Delete a Row Using Macro If a Cell Contains 0 in Excel (4 Methods)

The dataset below shows the Number of Visits, the Names of the Sites, and the Dates. Some sites have a cell value (Number of Visits) of 0. In such a situation, ...

0
How to Count Duplicates in Two Columns in Excel (8 Methods)

Column B depicts the List of US Companies by Revenue (List-1) while column D shows the List of US Companies by Profit (List-2). We’ll count the number of ...

0
How to Copy Rows in Excel with Filter (6 Fast Methods)

In this article, we will demonstrate 5 ways to copy filtered rows in Excel. We'll use the dataset below (B1:F16 cell range) to illustrate our methods. For ...

1
How to Autofilter and Copy Visible Rows with Excel VBA

The dataset below has 5 columns displaying a Site's name, Category, Date, Platform, and Number of Visits for each site. Method 1 – AutoFilter and Copy ...

0
How to Convert Active Directory Timestamp to Date in Excel (4 Methods)

Consider a dataset, there are 6 AD timestamps which need to be converted to readable dates. To do that, the example will use Sequential Serial Numbers in which ...

0
How to Convert String to  Double in Excel VBA (5 Methods)

  What is the CDbl Function? The VBA CDbl function converts an expression to a double. You'll see the following scenario if you insert the function in ...

0
Methods to Apply Continuous Compound Interest Formula in Excel

In this article, we'll demonstrate 6 methods and provide a calculator to calculate continuous compound interest using a formula in Excel. Basics of ...

0
How to Calculate Dividend Growth Rate in Excel (2 Methods)

While doing stock valuation, you need to find the dividend growth rate for accomplishing a better decision. Interestingly, you can compute the growth rate ...

1
How to Calculate Average and Standard Deviation in Excel

Basics of Average and Standard Deviation What is The Average The average is the arithmetic mean. Average = Sum of All Values/Number of Values ...

0
Unhide All Rows Not Working in Excel (5 Issues & Solutions)

In this article, we'll discuss 5 reasons why unhiding all rows is not working in Excel, and provide the solutions Reason 1 - Freeze Panes is Enabled In ...

0
How to Change & Restore Default Row Height in Excel

Method 1 - Changing Default Row Height There are two methods to change the default row height. 1.1. Changing Default Row Height by Altering the Font ...

0
Random Number Generator in Excel with No Repeats (9 Methods)

Method 1 - Using the RANDARRAY Function The RANDARRAY function, introduced in Excel 365, generates arrays of random numbers. For example, if you want 20 ...

0
How to Adjust Print Settings in Excel (8 Suitable Tricks)

Here's an overview of the print settings. For our sample dataset, we have two working sheets in the workbook. The first sheet contains the Monthly ...

0
How to Merge Text from Two Cells in Excel (7 Methods)

We’ll use the following dataset, with a list of first and last names. We'll merge those into full names in column D. Method 1 - Merging Text with ...

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