Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Why Doesn't it Clear??
Hello Everyone,
I thought the below macro would look on my noted page and take all the cells in the range with No and clear them, but it doesnt work. Any thoughts? Thanks - Roger Sub NoNo() For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents = True Next End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Why Doesn't it Clear??
Maybe the value isn't "No". Could it be "nO" or "NO" or "no" or "No " or " No "
or.... You may want to record a macro when you select B18:B65 and do an edit|replace what: No with: (leave blank) replace all You may it runs more quickly. Roger wrote: Hello Everyone, I thought the below macro would look on my noted page and take all the cells in the range with No and clear them, but it doesnt work. Any thoughts? Thanks - Roger Sub NoNo() For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents = True Next End Sub -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Why Doesn't it Clear??
c.ClearContents is all you need. not c.ClearContents = True
For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents Next "Roger" wrote in message ... Hello Everyone, I thought the below macro would look on my noted page and take all the cells in the range with No and clear them, but it doesnt work. Any thoughts? Thanks - Roger Sub NoNo() For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents = True Next End Sub |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Why Doesn't it Clear??
Much better answer!
DanRoss wrote: c.ClearContents is all you need. not c.ClearContents = True For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents Next "Roger" wrote in message ... Hello Everyone, I thought the below macro would look on my noted page and take all the cells in the range with No and clear them, but it doesnt work. Any thoughts? Thanks - Roger Sub NoNo() For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents = True Next End Sub -- Dave Peterson |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Why Doesn't it Clear??
But I still like my suggestion of using Edit|replace instead. <vbg
Dave Peterson wrote: Much better answer! DanRoss wrote: c.ClearContents is all you need. not c.ClearContents = True For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents Next "Roger" wrote in message ... Hello Everyone, I thought the below macro would look on my noted page and take all the cells in the range with No and clear them, but it doesnt work. Any thoughts? Thanks - Roger Sub NoNo() For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents = True Next End Sub -- Dave Peterson -- Dave Peterson |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Thank you!
sThanks so much to both of you Dan and Dave.
I couldn't get into my posts earlier and now I'm able to get in and view the results. Great ideas from both of you and it now work great. Thanks for your time and responses - Roger "Roger" wrote: Hello Everyone, I thought the below macro would look on my noted page and take all the cells in the range with No and clear them, but it doesnt work. Any thoughts? Thanks - Roger Sub NoNo() For Each c In Worksheets("Intro Page").Range("B18:B65").Cells If c.Value = "No" Then c.ClearContents = True Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
clear the clear the web page email attachment lines | Excel Discussion (Misc queries) | |||
How to clear a value but not the formula? | Excel Discussion (Misc queries) | |||
Clear data in row | Excel Discussion (Misc queries) | |||
Not clear | Excel Discussion (Misc queries) | |||
Clear all? | Excel Discussion (Misc queries) |