Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Get rid of CHAR(12)

Hi All.......

I have imported a flat text file, all in column A, and some rows contain the
little square symbol I think is the non-printing CHAR(12) character. How can
I delete all the rows that contain this symbol, please?

TIA
Vaya con Dios,
Chuck, CABGx3


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Get rid of CHAR(12)


"CLR" wrote in message
...
Hi All.......

I have imported a flat text file, all in column A, and some rows contain

the
little square symbol I think is the non-printing CHAR(12) character. How

can
I delete all the rows that contain this symbol, please?

TIA
Vaya con Dios,
Chuck, CABGx3



You can get rid of these characters by using the CLEAN function
http://www.techonthenet.com/excel/formulas/clean.htm

/Fredrik


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Get rid of CHAR(12)

Hi Chuck,

Dim i As Long
Dim cell As Range

For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
If InStr(1, Cells(i, "A").Value, Chr(12)) 0 Then
Cells(i, "A").EntireRow.Delete
End If
Next i

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"CLR" wrote in message
...
Hi All.......

I have imported a flat text file, all in column A, and some rows contain

the
little square symbol I think is the non-printing CHAR(12) character. How

can
I delete all the rows that contain this symbol, please?

TIA
Vaya con Dios,
Chuck, CABGx3




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Get rid of CHAR(12)


"CLR" wrote in message
...
Thanks Fredrik, that does do the job........but how might I write that

into
code?

Chuck


As the example shows, you can move your data to a different column or sheet.

/Fredrik


  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Get rid of CHAR(12)

Thanks Fredrik, that does do the job........but how might I write that into
code?

Chuck


"Fredrik Wahlgren" wrote:


"CLR" wrote in message
...
Hi All.......

I have imported a flat text file, all in column A, and some rows contain

the
little square symbol I think is the non-printing CHAR(12) character. How

can
I delete all the rows that contain this symbol, please?

TIA
Vaya con Dios,
Chuck, CABGx3



You can get rid of these characters by using the CLEAN function
http://www.techonthenet.com/excel/formulas/clean.htm

/Fredrik





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Get rid of CHAR(12)

You want to delete the row where a cell contains chr(12) ?

Sub DeleteRow()
Dim rng As Range, rng1 As Range
With Cells
Set rng = .Find(Chr(12))
If Not rng Is Nothing Then
Set rng1 = rng
Do
Set rng1 = Union(rng1, rng)
Set rng = .FindNext(rng)
Loop While Intersect(rng, rng1) Is Nothing
End If
If Not rng1 Is Nothing Then _
rng1.EntireRow.Delete
End With
End Sub

--
Regards,
Tom Ogilvy


"CLR" wrote in message
...
Thanks Fredrik, that does do the job........but how might I write that

into
code?

Chuck


"Fredrik Wahlgren" wrote:


"CLR" wrote in message
...
Hi All.......

I have imported a flat text file, all in column A, and some rows

contain
the
little square symbol I think is the non-printing CHAR(12) character.

How
can
I delete all the rows that contain this symbol, please?

TIA
Vaya con Dios,
Chuck, CABGx3



You can get rid of these characters by using the CLEAN function
http://www.techonthenet.com/excel/formulas/clean.htm

/Fredrik





  #7   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Get rid of CHAR(12)

I see..........ok, thank you for your time and suggestion.

Vaya con Dios,
Chuck, CABGx3


"Fredrik Wahlgren" wrote in message
...

"CLR" wrote in message
...
Thanks Fredrik, that does do the job........but how might I write that

into
code?

Chuck


As the example shows, you can move your data to a different column or

sheet.

/Fredrik




  #8   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Get rid of CHAR(12)

That does the job for me very very nicely Bob........thank you most
kindly........maybe some day I'll understand how these things
work........and then again, maybe not<g

Vaya con Dios,
Chuck, CABGx3


"Bob Phillips" wrote in message
...
Hi Chuck,

Dim i As Long
Dim cell As Range

For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
If InStr(1, Cells(i, "A").Value, Chr(12)) 0 Then
Cells(i, "A").EntireRow.Delete
End If
Next i

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"CLR" wrote in message
...
Hi All.......

I have imported a flat text file, all in column A, and some rows contain

the
little square symbol I think is the non-printing CHAR(12) character.

How
can
I delete all the rows that contain this symbol, please?

TIA
Vaya con Dios,
Chuck, CABGx3






  #9   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Get rid of CHAR(12)

Another great solution that works excellently.........Thank you very much
Tom........you always hit the spot.

Vaya con Dios,
Chuck, CABGx3




"Tom Ogilvy" wrote in message
...
You want to delete the row where a cell contains chr(12) ?

Sub DeleteRow()
Dim rng As Range, rng1 As Range
With Cells
Set rng = .Find(Chr(12))
If Not rng Is Nothing Then
Set rng1 = rng
Do
Set rng1 = Union(rng1, rng)
Set rng = .FindNext(rng)
Loop While Intersect(rng, rng1) Is Nothing
End If
If Not rng1 Is Nothing Then _
rng1.EntireRow.Delete
End With
End Sub

--
Regards,
Tom Ogilvy


"CLR" wrote in message
...
Thanks Fredrik, that does do the job........but how might I write that

into
code?

Chuck


"Fredrik Wahlgren" wrote:


"CLR" wrote in message
...
Hi All.......

I have imported a flat text file, all in column A, and some rows

contain
the
little square symbol I think is the non-printing CHAR(12) character.

How
can
I delete all the rows that contain this symbol, please?

TIA
Vaya con Dios,
Chuck, CABGx3



You can get rid of these characters by using the CLEAN function
http://www.techonthenet.com/excel/formulas/clean.htm

/Fredrik







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
char() oldLearner57 Excel Discussion (Misc queries) 4 July 17th 08 10:42 AM
FIND 1 char in cell of any 3 char =True Nastech Excel Discussion (Misc queries) 5 April 26th 08 02:17 PM
8500 cells with phone number(7 char.), wishing to add area code (10 char.) [email protected] Excel Discussion (Misc queries) 6 March 10th 06 05:13 PM
CHAR(10) JJ Excel Worksheet Functions 4 April 4th 05 10:46 PM
How to removed the first three char and last char in XLS Lillian Excel Programming 1 December 21st 04 12:34 AM


All times are GMT +1. The time now is 09:31 AM.

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"