(Edited by HansV to make URL clickable – see Help 19)
Hi,
I have to start working with a new web -based extract that exports data into Excel 3.0 format. I can resave as the current version of Excel. The extract puts sticky spaces in blank cells and this is causing problems with a macro that I run. The person that wrote the macro is long gone and I don’t know how to get into it. I just click on the .xla file and a small toolbar pops up with a few options.
I found this from an earlier post :
Another thing to watch for is embedded “sticky spaces” (ASCII 160) . Some accounting programs will add “sticky spaces” to ensure that the numbers do not get reformatted. Excel knows to “trim” off regular spaces but treats “sticky-spaces” like regular text so many of the “conversion tricks” will not get rid of them.
Many times just find -0160 (hold alt key and type (no quotes): “0160” on numeric keypad) and replace with “nothing” [leave replace box “blank”] will get excel to automatically convert them.
:
I have tried doing a find and replace, but just can’t seem to get the ” Alt 0160″ into the find box.
If I filter the columns on blanks and overkey all the blanks with zeroes, then my macro works. This is not a practical solution for large amounts of data.
Does anyone have a method other than the one above of getting a sticky space into the FIND box?
At this site : http://www.ozgrid.com/forum/showthread/?t=31054%5B/url%5D
I found
This removes most unwanted characters: use it to clean the cells before populating:
Goes in a standard module:
VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses “quotes”.
Function MEGACLEAN(Text As Variant)
‘ Function for removing characters
‘ Author: Parry
Dim NewVal As Variant
If IsMissing(Text) Then Exit Function
Application.Volatile True
NewVal = Trim(Text) ‘remove spaces
NewVal = Application.WorksheetFunction.Clean(NewVal) ‘remove most unwanted characters
NewVal = Application.WorksheetFunction.Substitute(NewVal, Chr(127), “”) ‘remove ASCII#127
NewVal = Application.WorksheetFunction.Substitute(NewVal, Chr(160), “”) ‘remove ASCII#160
MEGACLEAN = NewVal
End Function
would this work in Excel?
Thanks
capri