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 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)

String and Double are two major data types used in VBA. Often you may need to convert the string to double. In this article, I’ll show you 5 methods to convert ...

0
Methods to Apply Continuous Compound Interest Formula in Excel

In some cases especially in financial analysis, you may need to calculate continuous compound interest. In this article, I’ll show you 6 methods as well as ...

1
How to Calculate Average and Standard Deviation in Excel

Calculating average and standard deviation are often necessary while doing data analysis. However, the manual method of calculating those is not only ...

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

In many cases, you have to unhide unnecessary rows to make particular rows more presentable. Unfortunately, you may get troubled if unhiding all rows is not ...

0
How to Change & Restore Default Row Height in Excel

In many cases, we need to change the default row height in Excel. Again, we may need to recover the previous default row height. In this article, I’ll discuss ...

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

For specific purposes (e.g. phone number, lottery, statistical sampling), we have to generate random numbers without repetition. However, you may get ...

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

Whenever you want to print any documents or any things in Excel, you may adjust the default print settings for getting the best output based on your input. In ...

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

Sometimes we need to merge multiple cells into one to get the desired output. Undoubtedly, Excel provides some quickest features to do that. In this article, ...

1
How to Insert a Clustered Column Chart in Excel

Without a doubt, charts in Excel are an outstanding tool to portray any data graphically instead of showing a complex table with lots of fields. More ...

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

Often we need to use AutoFill for filling the cell or cell range downwards, upwards, and so on instead of entering the data repeatedly. How would you feel if ...

0
How to Sort Unique List in Excel (10 Useful Methods)

When you have a larger dataset and you need to sort the dataset based on unique values, that is to say, you want to skip duplicate values. Getting such type of ...

0
How to Remove a Header in Excel (4 Methods)

A header is a significant tool for presenting a dataset by adding a title, date, page no., or anything else at the top of the sheets in Excel. But ...

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 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 ...

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