[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to fill excel cell with different color

Posted on 2011-03-18
1
Medium Priority
?
515 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
jerbear1337 earned 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

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…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

650 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