Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default 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
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
clear the clear the web page email attachment lines MCrider Excel Discussion (Misc queries) 0 November 11th 07 10:05 PM
How to clear a value but not the formula? Shelly Excel Discussion (Misc queries) 7 December 10th 06 12:14 AM
Clear data in row sharon2006 Excel Discussion (Misc queries) 0 March 16th 06 05:51 AM
Not clear dkuz Excel Discussion (Misc queries) 4 February 14th 06 05:45 PM
Clear all? sdmccabe Excel Discussion (Misc queries) 3 December 16th 05 07:51 PM


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