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 8935675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:02:44+00:00 2026-06-15T10:02:44+00:00

I have a spreadsheet which has a column on it (say column A). The

  • 0

I have a spreadsheet which has a column on it (say column A). The idea is this column is populated by a user with various scores. Once the user is happy with their answers in column A, I want them to confirm that the answers are correct (ideally by clicking a button). Once that button is clicked, I want to use VBA to protect column A against being edited again. I’d rather not use the protect worksheet option, as there is additional data in the spreadsheet where I need to keep some cells locked but editable (they use data validation lists).

I did find this bit of VBA but this is based on worksheet change – if I could somehow use this but only have it activate once the user has confirmed the data is set, that would be ideal:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)    
    If Intersect(Target, Range("A2:A14")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    MsgBox "Hey, leave me alone!", 48, "Sorry, I'm protected."
    Application.Undo
    Application.EnableEvents = True
End Sub
  • 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-15T10:02:47+00:00Added an answer on June 15, 2026 at 10:02 am

    If what you posted suits your needs then:

    In a module, something like this:

    Public active As Boolean
    Sub Button1_Click()
       active = True
    End Sub
    

    And within your spreadsheet code:

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
        If active Then
            If Intersect(Target, Range("A2:A14")) Is Nothing Then Exit Sub
            Application.EnableEvents = False
            MsgBox "Hey, leave me alone!", 48, "Sorry, I'm protected."
            Application.Undo
            Application.EnableEvents = True
        End If
    End Sub
    

    A likely better solution would be to designate a cell within your sheet that the button populates, so the code would actually be something like:

    If Range("A1") = "Locked" then
        ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a spreadsheet I created mid-August which has a table with one column
I have spreadsheet which has column of 404 error link and its respective 301
I have a web app which lets the user select the excel spreadsheet and
I have one spreadsheet which has 5 sheets All the sheets share the same
I have a C# Silverlight app that lets the user select which spreadsheet they
Alright, I have a column named id which has 2000 ids in them, and
I have one Excel spreadsheet which has the following columns: Surname / First Name
I have a spreadsheet that I am sorting based on an item number column.
I have an xml resultset which has to be converted using XSL for display
I have an object Project which has a number of fields, one of which

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.