Text data pulled to excel shows small rectangle characters

irfananeeza

Active Member
Joined
Feb 15, 2008
Messages
334
Office Version
  1. 2010
Folks, I am experiencing a very bizarre problem.

I have data being extracted from a text file to excel via a macro. However, when data gets pulled to the excel file it also shows small rectangle characters along with data.

I am not sure how to get rid of those small rectangle signs. Trim function does not work.

Any idea how to get rid of them via a macro.?

Thanks,
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
don't really what they are (embedded csv format??) not if select toolbars - control toolbox - Design Mode, you will be able to select these manually and delete accordingly
 
Upvote 0
where is it located within the cell? at the beginning or in the middle or at the end?

try one of these to identify what that char is,

if at the beginning,

=CODE(LEFT(A1,1))

if at end

=CODE(RIGHT(A1,1))

you will get a numeric code (ASCII),

now Ctrl + H (Replace)

in find what -> Alt + 0 & the char code you got
Replace with blanks

-> Replace All
 
Upvote 0
Thanks to both for the answer.

First of all, I checked the code character by using =code(right(b3,1)) and it comes up as 9. The characters are showing up on the right side. I did Cntrl+H and then in the "FIND WHAT" box I tried to do Alt+0 9 but it did not work. Rather, when I press Alt and while pressing Alt I press 0 and then 9 nothing comes up in the FIND WHAT box. So not sure what am I doing wrong here. Please clarify.

Secondly, it would be great if I can find a little code or a macro solution which I can add in my existing macro to get rid of this problem. I have tested my macro on Excel 2002 & 2003 versions. Both show me the rectangles when I extract data using this macro.

rgds,
 
Upvote 0

Forum statistics

Threads
1,221,519
Messages
6,160,296
Members
451,636
Latest member
ddweller151

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top