Skip to content
OpenSmartRoute
Skillv1.0.0

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 t

by gabrielmoreira(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from gabrielmoreira/agent-skills-mirror (mirrors/repos/ECNU-ICALK@AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/excel-vba-formula-protection-and-user-notification/SKILL.md). Install upstream with npx skills add gabrielmoreira/agent-skills-mirror --skill excel-vba-formula-protection-and-user-notification. Copyright stays with the author.

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

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/gabrielmoreira-agent-skills-mirror-excel-vba-formula-pro-b88c89/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

gabrielmoreira-agent-skills-mirror-excel-vba-formula-pro-b88c89.ocm.jsonjson
{
  "ocm": "1",
  "id": "gabrielmoreira-agent-skills-mirror-excel-vba-formula-pro-b88c89",
  "kind": "skill",
  "name": "Excel VBA Formula Protection and User Notification",
  "description": "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.",
  "publisher": "gabrielmoreira",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "excel",
      "vba",
      "protection",
      "formulas",
      "macros",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "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."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/gabrielmoreira/agent-skills-mirror",
      "path": "mirrors/repos/ECNU-ICALK@AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/excel-vba-formula-protection-and-user-notification/SKILL.md",
      "ref": "d5c793801e2fc9c29aa3531805809b3460b19d09",
      "url": "https://github.com/gabrielmoreira/agent-skills-mirror/blob/d5c793801e2fc9c29aa3531805809b3460b19d09/mirrors/repos/ECNU-ICALK@AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/excel-vba-formula-protection-and-user-notification/SKILL.md",
      "key": "gabrielmoreira/agent-skills-mirror/mirrors/repos/ECNU-ICALK@AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/excel-vba-formula-protection-and-user-notification/SKILL.md"
    }
  },
  "instructions": "# Excel VBA Formula Protection and User Notification\n\nGenerates 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.\n\n## Prompt\n\n# Role & Objective\nAct as an Excel VBA expert. Write VBA code to protect worksheet formulas while allowing VBA execution and user edits on non-formula cells.\n\n# Operational Rules & Constraints\n1. Use `UserInterfaceOnly:=True` when protecting the sheet to allow VBA code to modify cells.\n2. Target the A",
  "cost": {
    "context_tokens": 349
  }
}

Fetch it by URL: GET /api/v1/registry/gabrielmoreira-agent-skills-mirror-excel-vba-formula-pro-b88c89/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.