Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default 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/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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/



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
Change background color of cell based on vlookup in cell Antney Excel Discussion (Misc queries) 1 October 19th 09 10:55 PM
Change Text Color in one cell based upon entry in referenced cell Tee Excel Discussion (Misc queries) 3 September 12th 08 10:07 PM
Excel: Syntax to change cell color based on color of another cell davew18 Excel Worksheet Functions 1 January 4th 07 01:24 PM
How do I change cell color based upon data range within the cell? Chris Sanders Excel Worksheet Functions 1 March 6th 06 08:59 PM
Change workbook sheet reference using cell A1 to change a vairable Reed Excel Worksheet Functions 4 January 20th 05 07:15 PM


All times are GMT +1. The time now is 05:45 AM.

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

About Us

"It's about Microsoft Excel"