Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing symbols? 1

Status
Not open for further replies.

AppStaff

Programmer
Sep 21, 2002
146
US
I have box that's produced in a report as a result of unseen characters in a field on my datasource.

?

I use ODBC on an oracle database to retrieve data to an MS Access 2002 database. My report is in Excel 2002 and uses MS Query to select data from my Access DB.

I'd like to program a way to get rid of these boxes but I haven't found a way to identify them yet. I've tried manually searching and replacing to determine what character this is exactly and I tried some code written by MS to do it. Nothing has been successful thus far.

Has anyone experienced this and developed a procedure for this? Currently I'm manually modifying this which is quite painful. Thanks for any responses.
 
Thanks for responding. I tried copy/paste and it doesn't recognize the symbol. I also used the character editor to find what it looked like to me and it didnt work either.

I believe its a carriage return character or line break or something to that effect that just doesn't convert properly. I don't see it in my access database but I do see the extra space there. I see it after the ms query returns my results.

I tried using trim on the field and sql to eliminate space and that didnt work either. It just reproduced what was already there.
 
Hi again, AppStaff ,

If these are, indeed, carriage returns, then this will work:

[ul][li]Go to Find and Replace[/li]
[li]for the "find" hold down <Alt> and type 0 1 0 on the NumPad (not the numbers at the top of the keyboard) then release <Alt>
note: you won't see anything appear in the "find" box - that's OK[/li]
[li]Leave the "replace with" box empty[/li][/ul]That's it!


Was that of any help?

[tt]-John[/tt]
________________________
To get the best answers fast, please read faq181-2886
 
John, unfortunately no. It tells me excel cannot find a match.

Phil, YES! Actually that does work. I'm not sure if there are hidden consequences yet and I'll need to research automation from access.

Thanks. Star awarded.
 
Your's worked Phil. I replied to you both by name in my prior post. Thanks! Any idea on how to automate this from access to excel?
 
Oops I'm sorry I realize now you meant which one of your suggestions worked Phil.

Apparently the text to columns works. I've never used that feature though so I'd like to research what exacltly its doing when I use it. I'll also need to determine how to automate this if I can from access.
 
I'd pop this in your personal.xls and then just run it against your report - Cleans up a lot of garbage characters when importing from other apps / the web.
Code:
Sub a_TrimALL()
   'David McRitchie 2000-07-03 mod 2000-08-16 join.htm
   Application.ScreenUpdating = False
   Application.Calculation = xlCalculationManual
      Dim Cell As Range
      'Also Treat CHR 0160, as a space (CHR 032)
       Selection.Replace what:=Chr(160), Replacement:=Chr(32), _
       LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
      'Trim in Excel removes extra internal spaces, VBA does not
   On Error Resume Next   'in case no text cells in selection
      For Each Cell In Intersect(Selection, _
         Selection.SpecialCells(xlConstants, xlTextValues))
         Cell.Value = Application.Trim(Cell.Value)
      Next Cell
   On Error GoTo 0
   Application.Calculation = xlCalculationAutomatic
   Application.ScreenUpdating = True
End Sub
Regards
Ken...........

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
---------------- Click here to help the tsunami victims ----------------

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top