Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am moving data to Excel from SQL that contains hard returns in these text
fields. I need to remove the hard return values (they look like little boxes) using VBA. I can do it manually by activating the cell and simply deleteing them. The hard return still exists even when the symbol is removed. That is what I need to do in code. Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Remove_CR_LF()
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False Selection.Replace What:=Chr(13), Replacement:=Chr(32), _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False Selection.Replace What:=Chr(10), Replacement:=Chr(32), _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False End Sub Gord Dibben MS Excel MVP On Wed, 20 Jun 2007 14:18:07 -0700, Troubled User wrote: I am moving data to Excel from SQL that contains hard returns in these text fields. I need to remove the hard return values (they look like little boxes) using VBA. I can do it manually by activating the cell and simply deleteing them. The hard return still exists even when the symbol is removed. That is what I need to do in code. Thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Chr(127) is "return." So you could loop thru the cells and delete it
when found. Hth, Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Removing hard returns | Excel Discussion (Misc queries) | |||
hard returns | Excel Discussion (Misc queries) | |||
Trim for Hard Returns | Excel Programming | |||
Hard returns in a formula? | Excel Worksheet Functions | |||
how to remove hard returns, which show as little boxes | Excel Discussion (Misc queries) |