Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Conditional Formatting Macro?

Hello,

I would like to write a macro that goes into all the tabs in a work book and
conditional formats the cells to white font if the numbers are equal to or
between negative 499,999.00 and positive 499,999.00 can this be done?

thanks so much.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Conditional Formatting Macro?

One way:

Public Sub FormatSmallValuesWhite()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.Cells
.FormatConditions.Delete
With .FormatConditions.Add( _
Type:=xlCellValue, _
Operator:=xlBetween, _
Formula1:="-499999", _
Formula2:="499999")
.Font.Color = RGB(255, 255, 255)
End With
End With
Next ws
End Sub

In article ,
mydogpeanut wrote:

Hello,

I would like to write a macro that goes into all the tabs in a work book and
conditional formats the cells to white font if the numbers are equal to or
between negative 499,999.00 and positive 499,999.00 can this be done?

thanks so much.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Conditional Formatting Macro?

Works great thank you very much!

A couple of follow up questions...

1) the numbers I am pulling into the spreadsheets are being pulled in from
an excel ad in and comes in as text and I need to "convert to number" in
order for the conditional formatting to work. Is there a macro that can be
written to do this?

2) With the conditional formatting macro provided below is there a way to
specify what cells in the worksheets you want changed? For example A1:AW22?

Thanks!

"JE McGimpsey" wrote:

One way:

Public Sub FormatSmallValuesWhite()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.Cells
.FormatConditions.Delete
With .FormatConditions.Add( _
Type:=xlCellValue, _
Operator:=xlBetween, _
Formula1:="-499999", _
Formula2:="499999")
.Font.Color = RGB(255, 255, 255)
End With
End With
Next ws
End Sub

In article ,
mydogpeanut wrote:

Hello,

I would like to write a macro that goes into all the tabs in a work book and
conditional formats the cells to white font if the numbers are equal to or
between negative 499,999.00 and positive 499,999.00 can this be done?

thanks so much.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Conditional Formatting Macro?

2) Replace

With ws.Cells

with

With ws.Range("A1:AW22")

1) One way (assuming no array formulae):

After

With ws.Range("A1:AW22")

enter the line

.Value = .Value



In article ,
mydogpeanut wrote:

1) the numbers I am pulling into the spreadsheets are being pulled in from
an excel ad in and comes in as text and I need to "convert to number" in
order for the conditional formatting to work. Is there a macro that can be
written to do this?

2) With the conditional formatting macro provided below is there a way to
specify what cells in the worksheets you want changed? For example A1:AW22?

Thanks!

"JE McGimpsey" wrote:

One way:

Public Sub FormatSmallValuesWhite()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.Cells
.FormatConditions.Delete
With .FormatConditions.Add( _
Type:=xlCellValue, _
Operator:=xlBetween, _
Formula1:="-499999", _
Formula2:="499999")
.Font.Color = RGB(255, 255, 255)
End With
End With
Next ws
End Sub

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
Conditional Formatting & Macro MickyRat Excel Discussion (Misc queries) 0 May 27th 10 10:05 PM
Conditional Formatting Macro Daren Excel Discussion (Misc queries) 2 June 27th 07 10:58 PM
Macro Conditional Formatting Sandy Excel Worksheet Functions 2 May 10th 07 02:25 PM
Conditional Formatting in Macro shantanu oak Excel Discussion (Misc queries) 2 July 14th 06 01:11 PM
macro for conditional formatting No Name Excel Programming 8 October 27th 03 08:03 PM


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

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

About Us

"It's about Microsoft Excel"