LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional Formatting a range of cells

But here is a really really basic macro that will change it to red i
the active cell's value is greater than 5, change to blue if less tha
5, or change to black (automatic) if it equals 5. I don't know how t
have it work over an entire selection instead of just the active cell
I'm sure someone else can help out with that, but what I do is jus
start recording a macro, assign a shortcut key to it (like "r") an
this macro will automatically drop down to the next cell below th
active one after running the macro (activecell.offset(1,0).

Sub Colorchange()

If ActiveCell 5 Then 'Change the 5 to you
value
ActiveCell.Interior.ColorIndex = 3 'ColorIndex 3 = red
Else
If ActiveCell < 5 Then 'Change the 5 to you
value
ActiveCell.Interior.ColorIndex = 5 'ColorIndex 5 = blue
Else
If ActiveCell = 5 Then 'Change the 5 to you
value
ActiveCell.Interior.ColorIndex = 1 'ColorIndex 1 = black
End If
End If
End If
ActiveCell.Offset(1, 0).Select
End Sub


By setting this macro to a keyboard shortcut you can easily jump dow
the column, if you want to scroll across rows then change th
Offset(1,0) to Offset(0,1).Select

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

 
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
Conditional Formatting on Range of Cells RoadKill Excel Worksheet Functions 7 March 30th 10 02:23 AM
Conditional Formatting to a RANGE of cells Wojo Excel Discussion (Misc queries) 2 October 1st 09 03:09 PM
Conditional formatting a range of cells. DBane Excel Discussion (Misc queries) 4 July 30th 07 03:30 PM
Conditional formatting for range of cells? Compass Rose Excel Worksheet Functions 5 November 24th 06 07:07 PM
Conditional Formatting a range of cells Bernie Deitrick Excel Programming 0 May 7th 04 09:07 PM


All times are GMT +1. The time now is 06:51 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"