Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / August 2007

Tip: Looking for answers? Try searching our database.

cleaning up text macro by Alan Barasch

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve G - 30 Aug 2007 21:55 GMT
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
p45cal - 30 Aug 2007 22:48 GMT
Sheet.Cells(CountRow, CountCol).Value =
Application.WorksheetFunction.Clean (Sheet.Cells(CountRow,
CountCol).Value)

should all be on one line.
Signature

p45cal

> I downloaded from the web at the following site
>
[quoted text clipped - 31 lines]
> Application.ScreenUpdating = True
> End Sub
Steve G - 31 Aug 2007 20:21 GMT
> Sheet.Cells(CountRow, CountCol).Value =
> Application.WorksheetFunction.Clean (Sheet.Cells(CountRow,
[quoted text clipped - 41 lines]
>
> - Show quoted text -

To p45cal--Thank you.  Steve G
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.