Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I fill one cell color with text html/rgb color from another | Excel Discussion (Misc queries) | |||
make all cells in same row match cell formatted with fill color | Excel Discussion (Misc queries) | |||
word match in string text in cell, color format cell | Excel Discussion (Misc queries) | |||
I want to fill the cell color based upon the other cell condition | Excel Discussion (Misc queries) | |||
I am trying to color fill a cell based on specific criteria | Excel Discussion (Misc queries) |