Solved

How to fill excel cell with different color

Posted on 2011-03-18
1
501 Views
Last Modified: 2012-05-11
I have two questions.

1  I have excel sheet, I want to fill with different color based upon the string of the cell.
For example, I have for different string like Completed, Not Completed, Waiting and Unknown in different cell of the sheet. I want to fill the entire raw of cell in green color if cell A2 contain the Completed and Red color to the entire raw of the cell contain Not Completed and do the same for based on the string.
Please advice me how to do it using excel VBA code.if possible provide me example vba code to do that.
2) How to lock a rang of cells to prevent edit by end-user. Entire raw of cell A to cell D and cell J to cell M will be locked not the entire sheet or workbook. user can edit all cell except the above specified cells without any password. but if they want to edit the cells of any raw it will ask for password.
Please advice how to do that if possible provide me exaple excel sheet with the explanation.

Thanks in advance for your prompt response and co-operation.
0
Comment
Question by:alam747
1 Comment
 
LVL 3

Accepted Solution

by:
jerbear1337 earned 500 total points
Comment Utility
To answer your first question.

http://www.techonthenet.com/excel/macros/change_color.php


And this should answer your second.


http://en.allexperts.com/q/Excel-1059/2008/2/Cell-protection-password.htm

(also a dirty trick i did once to keep ppl from editing specific fields was fill in the field with data i wanted displayed and then did a data validation on that field with "1=1"  then if someone try to change that field it throws an error and wont let them unless they remove the validation. just another trick i know to make fields un-editable )
0

Featured Post

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.

Join & Write a Comment

I wanted to share this with fellow Experts, who might not know. How often have you wanted to learn something, only to be set back by either restrictions imposed on "trial" or "evaluation" software?  How often have you had to rebuild a home networ…
This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
Viewers will learn the different options available in the Backstage view in Excel 2013.
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…

728 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

9 Experts available now in Live!

Get 1:1 Help Now