Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:55:36+00:00 2026-06-05T06:55:36+00:00

I learned that I need to write a macro if I want users to

  • 0

I learned that I need to write a macro if I want users to delete rows on a protected sheet.

This is the code I got by googling around:

Sub delete_row()
    ActiveSheet.Unprotect Password:="justme"
        ActiveCell.EntireRow.Delete
    ActiveSheet.Protect Password:="justme"
End Sub 

Where exactly should I place this code? Will it work if multiple rows are deleted etc.?

MrExcel is down today, so limited options.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:55:37+00:00Added an answer on June 5, 2026 at 6:55 am

    Paste this in a module

    Option Explicit
    
    Sub DeleteMe()
        Dim Ret As Range, Cl As Range
    
        On Error Resume Next
        Set Ret = Application.InputBox("Please select the Cells", "Delete Rows", Type:=8)
        On Error GoTo 0
    
        ActiveSheet.Unprotect Password:="justme"
    
        If Not Ret Is Nothing Then Ret.EntireRow.Delete
    
        ActiveSheet.Protect Password:="justme"
    End Sub
    

    When you run the above macro it will ask you to select the cell(s). Whatever cells you select, the entire row will get deleted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm required to write a JCE provider. I have learned that I need to
I learned that Xcode can compile c code, that means can we write whole
I have learned that you need to call dispose() on Graphics objects that you
After spending some hours with the Ruby Debugger I finally learned that I need
This is some basic code for an array I'm writing. I need to fill
So I've learned that I need an empty constructor in order for my fragments
Based on my reading around, I have learned that I need to set a
I learned that when executing commands in Python, I should use subprocess. What I'm
I learned that repaint() wasn't an actual method that repaints the screen. Rather, it
I've learned that Xor operation can be used to implement effective swap function. like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.