<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to Clean Selected Cells in an Excel workbook Using Macro Button and Trim(), Clean() and Replace()</title>
	<atom:link href="http://code-journey.com/2009/08/23/how-to-clean-selected-cells-in-an-excel-workbook-using-macro-button-and-trim-clean-replac/feed/" rel="self" type="application/rss+xml" />
	<link>http://code-journey.com/2009/08/23/how-to-clean-selected-cells-in-an-excel-workbook-using-macro-button-and-trim-clean-replac/</link>
	<description>Mostly SharePoint</description>
	<lastBuildDate>Thu, 05 Aug 2010 21:12:56 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Luciano</title>
		<link>http://code-journey.com/2009/08/23/how-to-clean-selected-cells-in-an-excel-workbook-using-macro-button-and-trim-clean-replac/comment-page-1/#comment-1787</link>
		<dc:creator>Luciano</dc:creator>
		<pubDate>Fri, 23 Apr 2010 03:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://code-journey.com/?p=404#comment-1787</guid>
		<description>this code do not work for me!</description>
		<content:encoded><![CDATA[<p>this code do not work for me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shg</title>
		<link>http://code-journey.com/2009/08/23/how-to-clean-selected-cells-in-an-excel-workbook-using-macro-button-and-trim-clean-replac/comment-page-1/#comment-373</link>
		<dc:creator>shg</dc:creator>
		<pubDate>Fri, 23 Oct 2009 14:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://code-journey.com/?p=404#comment-373</guid>
		<description>Public Sub CleanSelection()
    Dim cell        As Range
    Dim s           As String

    For Each cell In Intersect(Selection.Cells, ActiveSheet.UsedRange)
        If Not cell.HasFormula Then
            s = Replace(cell.Value, Chr(160), &quot; &quot;)
            s = Replace(s, Chr(127), &quot;&quot;)
            s = Replace(s, Chr(129), &quot;&quot;)
            s = Replace(s, Chr(141), &quot;&quot;)
            s = Replace(s, Chr(143), &quot;&quot;)
            s = Replace(s, Chr(144), &quot;&quot;)
            s = Replace(s, Chr(157), &quot;&quot;)
            s = Application.WorksheetFunction.Trim(s)
            cell.Value = Application.WorksheetFunction.Clean(s)
        End If
    Next cell
End Sub</description>
		<content:encoded><![CDATA[<p>Public Sub CleanSelection()<br />
    Dim cell        As Range<br />
    Dim s           As String</p>
<p>    For Each cell In Intersect(Selection.Cells, ActiveSheet.UsedRange)<br />
        If Not cell.HasFormula Then<br />
            s = Replace(cell.Value, Chr(160), &#8221; &#8220;)<br />
            s = Replace(s, Chr(127), &#8220;&#8221;)<br />
            s = Replace(s, Chr(129), &#8220;&#8221;)<br />
            s = Replace(s, Chr(141), &#8220;&#8221;)<br />
            s = Replace(s, Chr(143), &#8220;&#8221;)<br />
            s = Replace(s, Chr(144), &#8220;&#8221;)<br />
            s = Replace(s, Chr(157), &#8220;&#8221;)<br />
            s = Application.WorksheetFunction.Trim(s)<br />
            cell.Value = Application.WorksheetFunction.Clean(s)<br />
        End If<br />
    Next cell<br />
End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Code-Journey</title>
		<link>http://code-journey.com/2009/08/23/how-to-clean-selected-cells-in-an-excel-workbook-using-macro-button-and-trim-clean-replac/comment-page-1/#comment-44</link>
		<dc:creator>Code-Journey</dc:creator>
		<pubDate>Fri, 04 Sep 2009 06:47:23 +0000</pubDate>
		<guid isPermaLink="false">http://code-journey.com/?p=404#comment-44</guid>
		<description>Hi Orvar

Yeah I don&#039;t quite see why on earth it should be so troublesome to clean some cells.
It can take some time too, if you mess up. I used CTRL + A and started my macro yesterday. My oh my. I am sure I heard naughty words come out of our Citrix server.
Lesson for me was: Always select the range by hand. Cleaning all cells, dirty or not, takes a looong time. It was shut down after several hours.</description>
		<content:encoded><![CDATA[<p>Hi Orvar</p>
<p>Yeah I don&#8217;t quite see why on earth it should be so troublesome to clean some cells.<br />
It can take some time too, if you mess up. I used CTRL + A and started my macro yesterday. My oh my. I am sure I heard naughty words come out of our Citrix server.<br />
Lesson for me was: Always select the range by hand. Cleaning all cells, dirty or not, takes a looong time. It was shut down after several hours.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Orvar Ehn</title>
		<link>http://code-journey.com/2009/08/23/how-to-clean-selected-cells-in-an-excel-workbook-using-macro-button-and-trim-clean-replac/comment-page-1/#comment-43</link>
		<dc:creator>Orvar Ehn</dc:creator>
		<pubDate>Thu, 03 Sep 2009 20:36:22 +0000</pubDate>
		<guid isPermaLink="false">http://code-journey.com/?p=404#comment-43</guid>
		<description>NICE!!

We have suffered from clean()&#039;s inability to clean for a long time.... having to do a lot of hands on editing. Thanks!!

Also since i find (to my dissapointment) that there is no matching inserting functions in the worksheet in terms of speed I adapted your metod using functions.. enjoy..

=CLEAN(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(&lt;b&gt;R[X]C[X]&lt;/b&gt;,CHAR(160),&quot;&quot; &quot;&quot;),CHAR(127),&quot;&quot;&quot;&quot;),CHAR(129),&quot;&quot;&quot;&quot;),CHAR(141),&quot;&quot;&quot;&quot;),CHAR(143),&quot;&quot;&quot;&quot;),CHAR(144),&quot;&quot;&quot;&quot;),CHAR(157),&quot;&quot;&quot;&quot;)))&quot;
(replace the X&#039;es with the reference  to the cell to be CLEANED!!)

Cheers!!</description>
		<content:encoded><![CDATA[<p>NICE!!</p>
<p>We have suffered from clean()&#8217;s inability to clean for a long time&#8230;. having to do a lot of hands on editing. Thanks!!</p>
<p>Also since i find (to my dissapointment) that there is no matching inserting functions in the worksheet in terms of speed I adapted your metod using functions.. enjoy..</p>
<p>=CLEAN(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(<b>R[X]C[X]</b>,CHAR(160),&#8221;" &#8220;&#8221;),CHAR(127),&#8221;"&#8221;"),CHAR(129),&#8221;"&#8221;"),CHAR(141),&#8221;"&#8221;"),CHAR(143),&#8221;"&#8221;"),CHAR(144),&#8221;"&#8221;"),CHAR(157),&#8221;"&#8221;")))&#8221;<br />
(replace the X&#8217;es with the reference  to the cell to be CLEANED!!)</p>
<p>Cheers!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
