Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need a macro that does the following:
If a cell contains the text "N/A" I need the background color of the cell adjacent and to the left of it, copied and pasted into the cell with "N/A" So, B1 has "N/A". I need the background color from A1 copied into cell B1, leaving the text "N/A" intact. If B2 has "N/A" I need the background or fill color from cell A1 copied into B2. In all cases the fill color is just a solid color. I need no other formatting or content copied, just the fill color. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Paste this into a standard Module:
Sub tester() Set Rng = Selection For Each c In Rng If c = "N/A" Then c.Interior.ColorIndex = Range("A1").Interior.ColorIndex End If Next c End Sub Then before runing Macro - Highlite your cells (Say B1:B10) then run Tester. "MelB" wrote: I need a macro that does the following: If a cell contains the text "N/A" I need the background color of the cell adjacent and to the left of it, copied and pasted into the cell with "N/A" So, B1 has "N/A". I need the background color from A1 copied into cell B1, leaving the text "N/A" intact. If B2 has "N/A" I need the background or fill color from cell A1 copied into B2. In all cases the fill color is just a solid color. I need no other formatting or content copied, just the fill color. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
background-color every second row | Excel Discussion (Misc queries) | |||
how can I conditionally change font color, or background color? | Excel Worksheet Functions | |||
Default Border, Font Color, and Cell Background Color | Excel Discussion (Misc queries) | |||
Excel 2003 Font Color and Background Color | Excel Discussion (Misc queries) | |||
background color | Excel Discussion (Misc queries) |