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
Solved

How to fill excel cell with different color

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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 …

809 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