Solved

How to fill excel cell with different color

Posted on 2011-03-18
1
509 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
ID: 35171168
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
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…

735 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