Solved

How to fill excel cell with different color

Posted on 2011-03-18
1
507 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

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 …
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

786 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