Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
I have just imported a database and there is a charecter which appears to indicate a hard return or space. I need to remove it. If I copy the charecter (small sqaure box) it does not appear when I use find and replace. How do i get rid of it? Cheers -- Nenagh |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Saved from a previous post...
Chip Pearson has a very nice addin that will help determine what that character(s) is: http://www.cpearson.com/excel/CellView.htm Since you do see a box, then you can either fix it via a helper cell or a macro: =substitute(a1,char(13),"") or =substitute(a1,char(13)," ") Replace 13 with the ASCII value you see in Chip's addin. Or you could use a macro (after using Chip's CellView addin): Option Explicit Sub cleanEmUp() Dim myBadChars As Variant Dim myGoodChars As Variant Dim iCtr As Long myBadChars = Array(Chr(10), Chr(13)) '<--What showed up in CellView? myGoodChars = Array(" ","") '<--what's the new character, "" for nothing? If UBound(myGoodChars) < UBound(myBadChars) Then MsgBox "Design error!" Exit Sub End If For iCtr = LBound(myBadChars) To UBound(myBadChars) ActiveSheet.Cells.Replace What:=myBadChars(iCtr), _ Replacement:=myGoodChars(iCtr), _ LookAt:=xlPart, SearchOrder:=xlByRows, _ MatchCase:=False Next iCtr End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Nenagh wrote: Hi I have just imported a database and there is a charecter which appears to indicate a hard return or space. I need to remove it. If I copy the charecter (small sqaure box) it does not appear when I use find and replace. How do i get rid of it? Cheers -- Nenagh -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks very much Dave, worked a treat
Cheers -- Nenagh "Dave Peterson" wrote: Saved from a previous post... Chip Pearson has a very nice addin that will help determine what that character(s) is: http://www.cpearson.com/excel/CellView.htm Since you do see a box, then you can either fix it via a helper cell or a macro: =substitute(a1,char(13),"") or =substitute(a1,char(13)," ") Replace 13 with the ASCII value you see in Chip's addin. Or you could use a macro (after using Chip's CellView addin): Option Explicit Sub cleanEmUp() Dim myBadChars As Variant Dim myGoodChars As Variant Dim iCtr As Long myBadChars = Array(Chr(10), Chr(13)) '<--What showed up in CellView? myGoodChars = Array(" ","") '<--what's the new character, "" for nothing? If UBound(myGoodChars) < UBound(myBadChars) Then MsgBox "Design error!" Exit Sub End If For iCtr = LBound(myBadChars) To UBound(myBadChars) ActiveSheet.Cells.Replace What:=myBadChars(iCtr), _ Replacement:=myGoodChars(iCtr), _ LookAt:=xlPart, SearchOrder:=xlByRows, _ MatchCase:=False Next iCtr End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Nenagh wrote: Hi I have just imported a database and there is a charecter which appears to indicate a hard return or space. I need to remove it. If I copy the charecter (small sqaure box) it does not appear when I use find and replace. How do i get rid of it? Cheers -- Nenagh -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to make reference to database and if true copy from database? | Excel Discussion (Misc queries) | |||
Moved database, how do I change link to the database in excel | Excel Discussion (Misc queries) | |||
functions on imported database | Excel Worksheet Functions | |||
Transforming messy database into clean database | Excel Discussion (Misc queries) | |||
Imported objects | Excel Discussion (Misc queries) |