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

by:Ingeborg Hawighorst
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?

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

792 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