Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cell fill color. Row to match specific cell.

I need to have each row from A though G to set fill color to yellow when cell
E = "c".
I have conditional formatting on E already, but since I do not know VBA and
have not worked much with macros I cannot figure out how to do the rest.

Thank you for any help that is offered!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Cell fill color. Row to match specific cell.

hi CADinDallas

Try this
Sub Makro1()

Dim colE As Double
Dim i As Double
colE = Cells(Rows.Count, "E").End(xlUp).Row
For i = 1 To colE
If Range("E" & i) = "c" Then
Range("A" & i & ":G" & i).Interior.ColorIndex = 6
End If
Next i
end sub

Regards Yngve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell fill color. Row to match specific cell.


Hello CADinDallas

This code will highlight the cells A to G in yellow if cell E = "c"
Add this code to the Worksheet you want to have do this function. Prin
of a copy of these instructions before you begin

MACRO CODE:[/B
PRIVATE SUB WORKSHEET_CHANGE(BYVAL TARGET AS RANGE

DIM RNG AS RANG
DIM ROW AS LON

ROW = TARGET.RO

SET RNG = ACTIVESHEET.RANGE(CELLS(ROW, \"A\"), CELLS(ROW, \"G\")

IF TARGET.COLUMN = 5 AND TARGET.VALUE = \"C\" THE
RNG.INTERIOR.COLORINDEX =
END I

END SU
___________________________________

[b]INSTALLING THE MACRO
1. Copy the code to the clipboard by placing the mouse at the firs
line of code
2. Left click and hold the mouse button down while moving the mous
down to the last line of code
3. Release the left mouse button. The code should be highlighted
4. Press the CTRL key, hold it and press the C key. This will copy th
data to the clipboard
5. Open your Excel progra
6. After it has opened, press the ALT key, hold it, and press the F1
key. This opens the VBA Editor
7. Press the CTRL key, hold it, and press the R key. This wil
activate the Project Explorer window
8. Select the Worksheet you want from the "Microsoft Excel Objects
folder. If it is closed, click the plus "+" sign to the left of th
folder. This will open it
9. Double Left Click the Worksheet you want to install the macro in
10. Place the cursor in the large Window on the right. Press the CTR
key, hold it, and press the V key. This will paste the macro into th
Worksheet
11. Press the CTRL key, hold it, and press the S key. This will sav
the macro in your Excel program
12. To exit the VBA Editor and return to Excel, press the ALT key, hol
it, and press the Q key

You're done. The macro is now installed. Anytime the user types
single "c" into a cell in column E, the cells from A to G will b
highlighted in yellow

Sincerely
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49766

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cell fill color. Row to match specific cell.

Thank you both for your help. I know it may seem like a simple request, but
because of you, I have success!!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I fill one cell color with text html/rgb color from another thewris Excel Discussion (Misc queries) 2 January 22nd 09 12:24 AM
make all cells in same row match cell formatted with fill color zjopa Excel Discussion (Misc queries) 2 May 21st 08 04:26 AM
word match in string text in cell, color format cell jpmahony Excel Discussion (Misc queries) 1 October 31st 07 03:56 PM
I want to fill the cell color based upon the other cell condition sri Excel Discussion (Misc queries) 4 January 12th 06 01:47 PM
I am trying to color fill a cell based on specific criteria jglen Excel Discussion (Misc queries) 1 May 27th 05 05:30 PM


All times are GMT +1. The time now is 12:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"