ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete zeros in light yellow cells (https://www.excelbanter.com/excel-programming/281956-delete-zeros-light-yellow-cells.html)

Claude

Delete zeros in light yellow cells
 
I am working with a state mandated Excel template and need to write a macro
that will delete the contents of cells that first are light yellow
(.ColorIndex = 36) and second are not textual. I can write the necessary
macro in Lotus 123 but Excel is a whole different world.

The Excel template has merged cells, formulation in different colored cells
(which must remain unchanged) and 3,000 rows with columns to AJ in the
largest worksheet. Other worksheets in the file have fewer lines and fewer
columns. Each row has different merged cells. I need a repeating macro to
evaluate each cell individually and to delete only those light yellow cells
(or light yellow merged cells) that are not text and which evaluate to zero.

All help is greatly appreciated.

Thanks, Claude



J.E. McGimpsey

Delete zeros in light yellow cells
 
One way:

Public Sub ClearLightYellowNumbers()
Dim cell As Range
For Each cell In ActiveSheet.UsedRange
With cell
If IsNumeric(.Value) Then _
If .Value = 0 Then _
If .Interior.ColorIndex = 36 Then _
.MergeArea.ClearContents
End With
Next cell
End Sub


In article ,
"Claude" wrote:

I am working with a state mandated Excel template and need to write a macro
that will delete the contents of cells that first are light yellow
(.ColorIndex = 36) and second are not textual. I can write the necessary
macro in Lotus 123 but Excel is a whole different world.

The Excel template has merged cells, formulation in different colored cells
(which must remain unchanged) and 3,000 rows with columns to AJ in the
largest worksheet. Other worksheets in the file have fewer lines and fewer
columns. Each row has different merged cells. I need a repeating macro to
evaluate each cell individually and to delete only those light yellow cells
(or light yellow merged cells) that are not text and which evaluate to zero.


Nigel[_5_]

Delete zeros in light yellow cells
 
Check out this webpage
http://www.cpearson.com/excel/colors.htm

Cheers
Nigel

"Claude" wrote in message
...
I am working with a state mandated Excel template and need to write a

macro
that will delete the contents of cells that first are light yellow
(.ColorIndex = 36) and second are not textual. I can write the necessary
macro in Lotus 123 but Excel is a whole different world.

The Excel template has merged cells, formulation in different colored

cells
(which must remain unchanged) and 3,000 rows with columns to AJ in the
largest worksheet. Other worksheets in the file have fewer lines and fewer
columns. Each row has different merged cells. I need a repeating macro to
evaluate each cell individually and to delete only those light yellow

cells
(or light yellow merged cells) that are not text and which evaluate to

zero.

All help is greatly appreciated.

Thanks, Claude






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


All times are GMT +1. The time now is 02:28 PM.

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