Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default cleaning up text macro by Alan Barasch

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default cleaning up text macro by Alan Barasch

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default cleaning up text macro by Alan Barasch

On Aug 30, 5:48 pm, p45cal 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
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
Excel (or other) macro for cleaning date data [email protected] Excel Discussion (Misc queries) 3 July 25th 07 12:02 AM
Has anyone used arrayfunctions from Alan Beban? SteveT Excel Worksheet Functions 3 February 26th 07 07:52 AM
VlookupS-Alan Beban Deeds Excel Worksheet Functions 4 December 20th 05 12:03 AM
Cleaning text boxes jasonsweeney[_94_] Excel Programming 1 October 20th 05 05:48 AM
Cleaning Text James[_14_] Excel Programming 1 November 18th 03 09:33 PM


All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"