ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change Cell Color from cell vairable (https://www.excelbanter.com/excel-programming/301285-change-cell-color-cell-vairable.html)

Chillygoose

Change Cell Color from cell vairable
 
I need help changing the cell color of excel reports I receive.

when cell A1:A? cell D1:D? change cell color red

I cant use conditional formating because you have to input cell b
cell, it doesn't do a range.

I need to apply this macro/VBA to excel 2003 worksheets I receive an
apply to the whole document. I think it would be VBA, which I am no
very good with.

Any help is greatly appreciated.

Chill

--
Message posted from http://www.ExcelForum.com


JWolf

Change Cell Color from cell vairable
 
Select column A by clicking on the A at the top. Do
Format--Conditional Formatting--Formula is--=A1D1--Format select
red. No VBA needed. If you really want VBA just turn on the macro
recorder and do the steps above.

Chillygoose < wrote:
I need help changing the cell color of excel reports I receive.

when cell A1:A? cell D1:D? change cell color red

I cant use conditional formating because you have to input cell by
cell, it doesn't do a range.

I need to apply this macro/VBA to excel 2003 worksheets I receive and
apply to the whole document. I think it would be VBA, which I am not
very good with.

Any help is greatly appreciated.

Chilly


---
Message posted from http://www.ExcelForum.com/


Chillygoose[_2_]

Change Cell Color from cell vairable
 
It doesn't work like that, I already tried. I don't know th
size/amount of cells, it varies. I tried this code =$A:$A$D:$D unde
the formula portion of conditional formating and it didn't work.

Code is the only way, I tried this on a few cells just to see if i
would work =$A$1:$A25$$D$1:$D$25 it failed also

--
Message posted from http://www.ExcelForum.com


Rob van Gelder[_4_]

Change Cell Color from cell vairable
 
That's not really the way to use Conditional Formatting.

When you're entering your "Formula Is", pretend only the first cell in that
highlight range is selected.

So if you want to change colours for A1:A25:

Highlight A1:A25
Format | Conditional Formatting
Formula Is: =A1D1


Excel is smart about it. The conditional format for A2 will be =A2D2. A3
will be =A3D3. etc...


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chillygoose " wrote in message
...
It doesn't work like that, I already tried. I don't know the
size/amount of cells, it varies. I tried this code =$A:$A$D:$D under
the formula portion of conditional formating and it didn't work.

Code is the only way, I tried this on a few cells just to see if it
would work =$A$1:$A25$$D$1:$D$25 it failed also.


---
Message posted from http://www.ExcelForum.com/




Andrew B[_2_]

Change Cell Color from cell vairable
 
hi
This sub will work, however the sub must be able to run automatically when
the cell value changes, so you must store this sub in a special location
such as in the ThisWorkbook object.


Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

Range("B2").Interior.ColorIndex = 0
If Range("B2") Range("C2") Then Range("B2").Interior.ColorIndex = 3 'red

End Sub

Regards
Andrew Bourke



"Chillygoose " wrote in message
...
I need help changing the cell color of excel reports I receive.

when cell A1:A? cell D1:D? change cell color red

I cant use conditional formating because you have to input cell by
cell, it doesn't do a range.

I need to apply this macro/VBA to excel 2003 worksheets I receive and
apply to the whole document. I think it would be VBA, which I am not
very good with.

Any help is greatly appreciated.

Chilly


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 10:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com