What is the extra "thing" in the first cell?

tazeo

Board Regular
Joined
Feb 15, 2007
Messages
132
Office Version
  1. 365
Platform
  1. Windows
So I have a sheet that I import data from a reporting tool. Some of the headers have an extra "thing", no idea what it is. Try to do a search for Ctrl-J, for carriage return, it doesn't find anything.

I have a VBA script that identifies columns to keep for use, when the column header is like E1 the script and a simple countif search won't see that column, but I can find F1 using both.

All_Employee_Detail Better extract eddittiinngg.xlsx
EF
1Incident End Date Actual Consequence
Employee Detail All


Any thoughts on this will be great, spending far too long looking at this for what the importance is.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Clarification - If you copy and paste the two cells from the grab into a sheet you will see what I mean.
 
Upvote 0
Hi Tazeo,
I think XL2BB may remove it because both headings are 18 characters and I don't see anything spurious, but try =FIND(CHAR(160),E1) because I suspect it's a non-breaking space, probably ASCII 160 which you remove with SUBSTITUTE.
 
Upvote 0
Hi Tazeo,
I think XL2BB may remove it because both headings are 18 characters and I don't see anything spurious, but try =FIND(CHAR(160),E1) because I suspect it's a non-breaking space, probably ASCII 160 which you remove with SUBSTITUTE.
Thanks for that I get #VALUE! back. I will your substitute idea a bit later and let you know.
 
Upvote 0
Ok been playing with the answers so far, and come up with the following:
All_Employee_Detail Better extract eddittiinngg.xlsx
EFGHI
1#VALUE!Incident End Date 10Incident End Date
2Incident End Date
Employee Detail All
Cell Formulas
RangeFormula
E1E1=FIND(CHAR(160),E2)
F1F1=LEFT(E2,LEN(E2)-1)
G1G1=RIGHT(E2,1)
H1H1=CODE(G1)
I1I1=CLEAN(E2)


Think I will try and work out how to run clean as a Macro,
 
Upvote 0
The thing is likely a pilcrow. The Clean function will remove it. HTH. Dave
Looks like the easiest way to go. Can't work out how to use CLEAN as a VBA script to clean the top row. Trying to make it as a macro, any advice?

Really clumsy attempt:
Sub CleanTop()
Range("A1").Value = Application.WorksheetFunction.Clean(Range("A1"))
End Sub

PS starting to stray away from my comfort zones :)
 
Upvote 0
Seem like this would work. Adjust sheet name to suit. Untested code...
Code:
Dim LastCol As Integer, Rng As Range, R As Range
With Sheets("sheet1")
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
Set Rng = .Range(.Cells(1, 1), .Cells(1, LastCol))
End With
For Each R In Rng
R.Value = Application.WorksheetFunction.Clean(R.Value)
Next R
Dave
 
Upvote 0
Solution
Seem like this would work. Adjust sheet name to suit. Untested code...
Code:
Dim LastCol As Integer, Rng As Range, R As Range
With Sheets("sheet1")
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
Set Rng = .Range(.Cells(1, 1), .Cells(1, LastCol))
End With
For Each R In Rng
R.Value = Application.WorksheetFunction.Clean(R.Value)
Next R
Dave
Worked perfectly!!!

Thanks to all, really learnt a lot :)
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,530
Members
448,969
Latest member
mirek8991

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