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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Imported data to excel - need to remove the boxes 1

Status
Not open for further replies.

Lem9999

Programmer
Sep 22, 2004
1
US
I have .xls and .wks worksheets that have small boxes at the end of the TEXT data. How can I remove the small boxes? I have never written a macro and would like HELP...
 
Hi,

I presume that the "boxes" are non printable ascii characters, such as CHR$(10), suffixed to your text data.

If they are in your sheet cells, e.g. C1, you can remove inserting in a cell, e.g. A1, the formula =left(A1, len(A1)-1)

HTH.

_LF
 
'Here's a sub / macro that will do what you want...
'..USAGE: paste the code into a module
'highlite / select the cells, columns or rows that contain cluttered text.
'run the strip_char macro


Sub strip_char()
Dim inrange As Range
Set inrange = Selection
For Each c In inrange
If c.Formula = "" Then
Else
c.Formula = Application.WorksheetFunction.Clean(c.Value)
End If
Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top