Thread Subject: interior color and vba

Subject: interior color and vba

From: Ken Houghq

Date: 20 Nov, 2009 20:53:20

Message: 1 of 2

The question I have is as follows:

I have a sheet called (Master) I have fields within the sheet that I would like to color code.

I have four different fields that I will be checking on each column.

When there is a missing value in a particular field I want the color to highlight the entire Row in say green.

When another field is missing in the next row. I want that to be a different color.

I am using the follow code. It works on the orignal worksheets but it will not work now.

private sub workbook_sheetchange(byval sh as abject, byval target as range)

If target.Column = 12 then --purchase order--
if target ="" then
Thisworkbook.worksheets('MASTER").Rows(target.row).Interior.color =activeworkbook.colors(4) --green--
else if target ="NOTFOUND" then
thisworkbook.worksheets("Master").Rows(target.row).Interior.color = activeworkbook.colors(15) --Brown--

end if

I was wondering if I need to empty the sheet and then replace the code?

These are the fields on the top. Range A1 is the auto number I created.

RFI A2
Revsion B2
Request Date C2
Customer E-mail
Request Organization
Address/city/state/zip
Cell/office #'s
Respond By
Project
System
Unit
Po L2 OR Column 12
Info Request
Attachments
S Impact
C Impact
Add Days
Add Mat
Add Lab
Total
RPI Response
RPI Attachment
Responders name
Title
Response Date
Notes


I really need to have the entire rows to change colors based on the information that is missing.

Subject: interior color and vba

From: ImageAnalyst

Date: 21 Nov, 2009 01:46:13

Message: 2 of 2

Isn't this more of a VB question than a MATLAB question?
Here are the VB newsgroups:

For VB.Net:
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/topics?hl=en

For VB6:
http://groups.google.com/group/comp.lang.basic.visual.misc/topics?hl=en

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com