PC Review


Reply
Thread Tools Rate Thread

cleaning up text macro by Alan Barasch

 
 
Steve G
Guest
Posts: n/a
 
      30th Aug 2007
I downloaded from the web at the following site

http://www.xl.barasch.com/ACl12117.htm

code (except for a change I made in the dim statement becasue Mr.
Barasch made an honest mistake by confusing RowCount and CountRow and
some comments I added) by Alan Barash for cleaning up data in Excel
that was imported from a text file. The code is below. I cannot get
it to work. I suspect that something comes after

Sheet.Cells(CountRow, CountCol).Value =

but I do not know what to enter.

Any help would be appreciated. Thank you.

Steve G



Option Explicit

'Cleaning up those non-printing ASCII characters after a text import
'web page for code is: www.xl.barasch.com/ACl12117.htm Alan Barasch
Sub CleaningImportedText()
Dim CountRow As Long, CountCol As Long, Sheet As Object
Set Sheet = Application.ActiveSheet
Application.ScreenUpdating = False
For CountRow = 1 To 500
For CountCol = 1 To 50
Sheet.Cells(CountRow, CountCol).Value =
Application.WorksheetFunction.Clean (Sheet.Cells(CountRow,
CountCol).Value)
Next CountCol
Next CountRow
Application.ScreenUpdating = True
End Sub

 
Reply With Quote
 
 
 
 
New Member
Join Date: Aug 2007
Posts: 18
 
      30th Aug 2007
Just hit delete at the en dof the line to so the next line continues after the = sign
(the line was split for ease of reading)
 
Reply With Quote
 
=?Utf-8?B?cDQ1Y2Fs?=
Guest
Posts: n/a
 
      30th Aug 2007
Sheet.Cells(CountRow, CountCol).Value =
Application.WorksheetFunction.Clean (Sheet.Cells(CountRow,
CountCol).Value)

should all be on one line.
--
p45cal


"Steve G" wrote:

> I downloaded from the web at the following site
>
> http://www.xl.barasch.com/ACl12117.htm
>
> code (except for a change I made in the dim statement becasue Mr.
> Barasch made an honest mistake by confusing RowCount and CountRow and
> some comments I added) by Alan Barash for cleaning up data in Excel
> that was imported from a text file. The code is below. I cannot get
> it to work. I suspect that something comes after
>
> Sheet.Cells(CountRow, CountCol).Value =
>
> but I do not know what to enter.
>
> Any help would be appreciated. Thank you.
>
> Steve G
>
>
>
> Option Explicit
>
> 'Cleaning up those non-printing ASCII characters after a text import
> 'web page for code is: www.xl.barasch.com/ACl12117.htm Alan Barasch
> Sub CleaningImportedText()
> Dim CountRow As Long, CountCol As Long, Sheet As Object
> Set Sheet = Application.ActiveSheet
> Application.ScreenUpdating = False
> For CountRow = 1 To 500
> For CountCol = 1 To 50
> Sheet.Cells(CountRow, CountCol).Value =
> Application.WorksheetFunction.Clean (Sheet.Cells(CountRow,
> CountCol).Value)
> Next CountCol
> Next CountRow
> Application.ScreenUpdating = True
> End Sub
>
>

 
Reply With Quote
 
Steve G
Guest
Posts: n/a
 
      31st Aug 2007
On Aug 30, 5:48 pm, p45cal <p45...@discussions.microsoft.com> wrote:
> Sheet.Cells(CountRow, CountCol).Value =
> Application.WorksheetFunction.Clean (Sheet.Cells(CountRow,
> CountCol).Value)
>
> should all be on one line.
> --
> p45cal
>
>
>
> "Steve G" wrote:
> > I downloaded from the web at the following site

>
> >http://www.xl.barasch.com/ACl12117.htm

>
> > code (except for a change I made in the dim statement becasue Mr.
> > Barasch made an honest mistake by confusing RowCount and CountRow and
> > some comments I added) by Alan Barash for cleaning up data in Excel
> > that was imported from a text file. The code is below. I cannot get
> > it to work. I suspect that something comes after

>
> > Sheet.Cells(CountRow, CountCol).Value =

>
> > but I do not know what to enter.

>
> > Any help would be appreciated. Thank you.

>
> > Steve G

>
> > Option Explicit

>
> > 'Cleaning up those non-printing ASCII characters after a text import
> > 'web page for code is: www.xl.barasch.com/ACl12117.htm Alan Barasch
> > Sub CleaningImportedText()
> > Dim CountRow As Long, CountCol As Long, Sheet As Object
> > Set Sheet = Application.ActiveSheet
> > Application.ScreenUpdating = False
> > For CountRow = 1 To 500
> > For CountCol = 1 To 50
> > Sheet.Cells(CountRow, CountCol).Value =
> > Application.WorksheetFunction.Clean (Sheet.Cells(CountRow,
> > CountCol).Value)
> > Next CountCol
> > Next CountRow
> > Application.ScreenUpdating = True
> > End Sub- Hide quoted text -

>
> - Show quoted text -


To p45cal--Thank you. Steve G

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cleaning up Macro to Copy Word Formfields into Excel expect_ed Microsoft Excel Programming 9 3rd May 2009 06:41 PM
Excel (or other) macro for cleaning date data bliss.ryan@gmail.com Microsoft Excel Misc 3 25th Jul 2007 12:02 AM
To Norman or Alan Macro About Macros protected Sheets =?Utf-8?B?UGF1bC4=?= Microsoft Excel Misc 1 18th Nov 2004 11:52 PM
to: Alan@alan.alan: Previous Post Darcie Microsoft Excel Worksheet Functions 3 15th Sep 2004 11:20 PM
Cleaning Text James Microsoft Excel Programming 1 18th Nov 2003 09:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:23 PM.