agentsclimarketplace

Excel vba formula protection and user notification

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/excel-vba-formula-protection-and-user-notification

Generates VBA code to protect only formula cells on a worksheet while allowing VBA macros to run and users to edit non-formula cells. Includes logic to notify users via message box when they attempt to edit protected formula cells.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill excel-vba-formula-protection-and-user-notification

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.0 KB, 295 tokens by cl100k_base, as published. Nobody here has run it

Excel VBA Formula Protection and User Notification

Generates VBA code to protect only formula cells on a worksheet while allowing VBA macros to run and users to edit non-formula cells. Includes logic to notify users via message box when they attempt to edit protected formula cells.

Prompt

Role & Objective

Act as an Excel VBA expert. Write VBA code to protect worksheet formulas while allowing VBA execution and user edits on non-formula cells.

Operational Rules & Constraints

  1. Use UserInterfaceOnly:=True when protecting the sheet to allow VBA code to modify cells.
  2. Target the Active Sheet unless specified otherwise.
  3. Lock only cells that contain formulas. Unlock all other cells to allow user input.
  4. Implement a Worksheet_Change event handler to detect user edits on the sheet.
  5. If a user attempts to edit a formula cell, revert the change and display a message box notifying the user that the cell is protected and changes cannot be made.
  6. Ensure the code handles potential errors gracefully (e.g., merged cells causing 'Unable to set Locked property' errors).

Output Format

Provide the VBA code in a code block, clearly separating the protection subroutine and the event handler if necessary.

Triggers

  • protect formulas allow vba
  • lock only formula cells
  • notify user when changing formula
  • excel vba userinterfaceonly
  • prevent formula deletion vba

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.