Macro to prevent format change

Posted on 2013-11-24
Last Modified: 2013-11-26
Can we have a macro, probably trapped by worksheet_change event which will prevent any changes like color, borders, etc to a worksheet? It would be best if it works like a data validation giving a message box to the effect.
Question by:Saqib Husain, Syed
  • 3
  • 2

Accepted Solution

samrad1 earned 500 total points
ID: 39673830

You can do this w/o macros and use sheet protection which will prevent formatting ect. Just goto the review tab and choose Protect sheet, then at the dialog you can just click ok to protect it w/o a password (or enter a password if you prefer). :-)

Was there a reason you want macros instead?
LVL 50

Expert Comment

ID: 39673841
Bravo samrad1! (Good to see you here!)

I love solutions that can be done by ticking a box instead of writing a macro.

cheers, teylyn
LVL 43

Author Closing Comment

by:Saqib Husain, Syed
ID: 39673873
Hi, samrad1

I am with teylyn

There was no reason. Just never thought of it. Actually My own spreadsheets have almost no formatting other than bold and borders so I had never had the chance to explore this area.

This assignment is for all employees and I do not want them to muck with the formatting of the timesheets. I am sure protection will work just fine.

Thanks for the effort. How about an intro on your profile?

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.


Expert Comment

ID: 39674204
Yay! Good to see u 2 on here too! I'll fill out a little something on the profile soon, still getting a feel for everything on here :-)
LVL 43

Author Comment

by:Saqib Husain, Syed
ID: 39674213
Unless you have already been there you are welcome to join excel experts discussion topic at

Expert Comment

ID: 39677194
Oh I haven't, thanks for the link!

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now