ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Format Excel 2007 (https://www.excelbanter.com/excel-programming/421615-conditional-format-excel-2007-a.html)

Sue

Conditional Format Excel 2007
 
Hi All

This will be an easy one for you experts I need help with a macro
to solve the following

Range N3:N200 if any cell in the range has a value of either 40 or 80
then in the Range O3:O200 the cells will have a value of 0(zero) formatted
as 0.00 - Do not need any cell or text colours.

I would put a command button on the sheet and assign the macro

--
Many Thanks

Sue

Bob Umlas, Excel MVP

Conditional Format Excel 2007
 
Sub Answer()
For each oCell in range("N3:N200")
If oCell.Value = 40 or oCell.Value = 80 then
oCell.Offset(0,1).value = 0
oCell.Offset(0,1).NumberFormat = "0.00"
End If
Next
End Sub

"Sue" wrote:

Hi All

This will be an easy one for you experts I need help with a macro
to solve the following

Range N3:N200 if any cell in the range has a value of either 40 or 80
then in the Range O3:O200 the cells will have a value of 0(zero) formatted
as 0.00 - Do not need any cell or text colours.

I would put a command button on the sheet and assign the macro

--
Many Thanks

Sue


Sue

Conditional Format Excel 2007
 
Hi Bob

Just checked my mail and cut & pasted your reply into the sheet - worked
first time spot on your help is very much appreciated.
--
Many Thanks

Sue


"Bob Umlas, Excel MVP" wrote:

Sub Answer()
For each oCell in range("N3:N200")
If oCell.Value = 40 or oCell.Value = 80 then
oCell.Offset(0,1).value = 0
oCell.Offset(0,1).NumberFormat = "0.00"
End If
Next
End Sub

"Sue" wrote:

Hi All

This will be an easy one for you experts I need help with a macro
to solve the following

Range N3:N200 if any cell in the range has a value of either 40 or 80
then in the Range O3:O200 the cells will have a value of 0(zero) formatted
as 0.00 - Do not need any cell or text colours.

I would put a command button on the sheet and assign the macro

--
Many Thanks

Sue



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

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