Cleaning Workbook With Spaces Or Invisible Characters In Cells?

Sep 26, 2012

I have a worksheet that contains lots of value. I want to run quick calculation on it but for some reason counta function counts blank cells.

I checked and the cells with =len() and it returns a number > 1

What is the proper way to clean the whole worksheet with some copy paste value and get rid of invisible character like space or nonprintable ones to be sure to get the right number of cells with value?

View 9 Replies


ADVERTISEMENT

Remove Characters / Spaces After Text For All Cells Within Range

Oct 12, 2013

Initially I'm simply copying a data table from a web page using "Ctrl + A" then "Ctrl + C", and then pasting the data straight onto a new worksheet so I can work with it. (After temporarily re-naming the old sheet)

But I keep finding what looks like double-spaces after some of the important text within the Range of cells I'm working with. I need to be able to select & conditional format the values of the text in some columns of the sheet, so need to loose these trailing spaces.

Unfortunately, it's not consistence as to how many spaces trail the text I need. Sometimes it's only one space, sometimes its two spaces ?

So far, I've had mixed success with a recorded "Replace" code but none of the other codes I have found on forum pages either don't work all or seem to give any consistent results. E;g; TRIM, CLEAN

I suspect my problem is, I do not know how to call the code properly, or trying to work with too large a range ?

The start of my code reads:

Code:

Sheets("Data").Select
Sheets("Data").Name = "Old Data"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Select
ActiveSheet.Name = "Data"

[Code]...

' At the moment I'm using to select the pasted range I want to work on: Range(Range("C46"), Range("C46").SpecialCells(xlLastCell)).Select

This is where I need a code to work on the new Data sheet and remove all the trailing characters.

MsgBox "All data cleaned successfully !", vbInformation + vbOKOnly, "All Done"

View 3 Replies View Related

Copying Invisible Columns, But Not Invisible Rows

Nov 4, 2008

I'm using the following code, which I figured out quite by accident out of happy coincidence that somebody else on here asked about selecting only visible rows:

View 4 Replies View Related

Replace Characters With Spaces?

Dec 10, 2011

A range of cells contain characters that i want to replace with spaces. The problem is that the length of the string differs and also the characters differ.

For example, below a list of cell values:

GR
GRKR
GRKRKR
GRKRK1
GRON
GRONBL

As a result for the first value i want 2 spaces, for the second one 4 spaces etc.

Is it possible to do this with a formula? I don't want to use VBA for this if possible...

View 5 Replies View Related

Remove Spaces From Chinese Characters

Jan 9, 2012

I am trying to do a vlookup. I receive a report that gives the data as hyperlinks. I run a macro to remove the hyperlinks. I'm then left with a name that i want to match using a vlookup to get other data. The names are Chinese characters. I have tried using trim and clean function but its still leaving a space after the name. If i fo in manually and delete the space at the end the vlookup works fine. How to remove the spaces? i have about 5000 rows.

学员名字EliteNumber刘传佳=TRIM(A2)=VLOOKUP(B2,Sheet3!B:D,3,FALSE)刘传佳=VLOOKUP(D2,Sheet3!B1:D3550,3,FALSE)刘传佳 =TRIM(A3)刘传佳=VLOOKUP(D3,Sheet3!B2:D3551,3,FALSE)钟才富 =TRIM(A4)钟才富=VLOOKUP(D4,Sheet3!B3:D3552,3,FALSE)张杰 =TRIM(A5)张杰=VLOOKUP(D5,Sheet3!B4:D3553,3,FALSE)
刘传佳刘传佳刘传佳2001425刘传佳 刘传佳 刘传佳2001425钟才富 钟才富 钟才富800857张杰 张杰 张杰#N/A

View 8 Replies View Related

VBA - Removing Front Spaces And Special Characters

May 26, 2009

i have data which has lots of these hyphen "-" how can i get rid of them,

for example -Eq Cash-

i need the result to be

Eq Cash

Also i have lots of front spaces in my data, how can i get rid of those? so for example
Test (there is 2 spaces before T)

View 9 Replies View Related

Cleaning Up Address List - Some Are Single Cells / Some Are Double?

Mar 7, 2013

My problem has to do with an list of over 22,000 addresses (don't want to think about going through it manually )

The names are in column A and the addresses are in column B. The problem is, is that some of the addresses fit in one cell and others are spread over two (Oklahoma City, OK in one cell, 73034 in the one below it, for example.)

The names with corresponding addresses taking up two squares have been placed in merged cells, so that they line up with their addresses. Here is a picture below.

Capture.PNG

What I need is each address in one cell next to its address in one cell (to make it searchable, etc.) I thought I was being really clever when I copied Column A, then pasted the formatting onto Column B (so that the cells would be 1:1, one name cell, one address cell) but didn't realize I would be losing the information in the cells being merged.

View 5 Replies View Related

Sort Values Which Has Numeric, Spaces And Capital Letter Characters

Oct 8, 2009

I would like to sort words or data which has the First capital letter, words which has spaces and words which contains number... i have attached a sample file.

View 9 Replies View Related

Excel 2007 :: Ensure Cell Postcode Have 8 Characters (including Spaces)

Oct 8, 2012

Excel 2007.I have a list of postcodes (UK) which have different lengths of characters (including spaces) from 6-8, however our system seems to add additional spaces inbetween the postcode, so it could have upto 11/12 characters (inc spaces) Below is what could come out:

EH21 6PQ - 1 Space (8 Char)
EH12 9HG - 3 Spaces (10 Char)
E1 8DF - 3 Spaces (8 Char)
LL5 1GH - 2 Spaces (8 Char)
L5 1FG - 1 Space (6 Char)

What I need is a formula to ensure each postcode only has 8 characters by inserting spaces between if there's less than 8 char and trimming if there's more than 8 char

So from the above postcodes the desired results would be:

EH21 6PQ - 1 Space (8 Char) - This would be correct
EH12 9HG - 3 Spaces (10 Char) - Trim off 2 spaces from the middle
E1 8DF - 3 Spaces (8 Char) - This would be correct
LL5 1GH - 2 Spaces (8 Char) - This would be correct
L5 1FG - 1 Space (6 Char) - Insert 2 spaces in the middle

View 9 Replies View Related

Make Cells Invisible Until They Are Populated?

Jun 5, 2014

I'm trying to create an accounting document, but stuck in couple fields

1) Make balance appear in column E5 only if column C5 OR D5 is polulated, so goes for the rest of the cell in that colu

2) I like to have 2 digits after the decimal but (same as above) i want it to appear ONLY if there are any decimals to that number, all those 0 become confusing.

3) I need to make it so the last calculated cell on sheet Jan of column E gets transfered auto to sheet Feb D3 of F3 so the calculations could proceed to the next month

View 11 Replies View Related

Function Ignore Invisible Cells

Jun 26, 2006

Does this function ignore invisible cells (autofilter) ?

If not, what could be an alternative?

View 14 Replies View Related

Trying To Stop Invisible Cells From Printing

Aug 16, 2006

I have a sheet set up with invisible values in certain cells. To make them invisible, I have coloured the font the same as the backround. The colour used is a light shade of yellow, colour index 36 I think.

Unfortunately, even though the values in these cells are invisble on the screen, they are visible when the sheet is printed. Is there any way to stop these cells from being printed? Note that they are scattered all around the place.

View 9 Replies View Related

Excel 2007 :: Force Characters And Spaces In A Cell Over 80 To New Cell?

Jun 16, 2014

Using Excel 2007. I have a limit of 80 characters and spaces in a particular cell and I need to force those characters/spaces over 80 to the next cell. Is that possible?

View 11 Replies View Related

Inscribing Cells: Run A Macro On Enter Keypress, That Would Execute Different Code Depending On That "inscription" That Would Be Invisible To User

Feb 20, 2007

Is there any way to "Inscribe" a cell? I would like to run a macro on Enter keypress, that would execute different code depending on that "inscription" that would be invisible to user. I could use some properties of . Validation property like this:

Private Sub EnterPressed
'following code to ensure proper functioning of Enter in any other Worksheet
If ActiveSheet <> mySheet 'MySheet is global Variable then
ActiveCell.Offset(1,0).Select
exit Sub
End If
'now the real code
If ActiveCell.Validation.InputMessage = "1" Then
ActiveCell.Offset(0,1).Select
Else
'something else
End If
End Sub

The problem is, I use Data Validation and Conditional Formatting, so can't use any of these properties.

View 8 Replies View Related

Cleaning Up My Code

Dec 22, 2008

I am basically doing some housekeeping and trying to reduce my number of code lines.
Can this bit of code be done a bit simpler?

For r = lrow To 15 Step -1
If Range("N" & r).Interior.Color = vbRed Then
Range("N" & r).Interior.Color = vbCyan
Range("N" & r).Value = "Triangular"
End If
If Range("V" & r).Interior.Color = vbRed Then
Range("V" & r).Interior.Color = vbCyan
Range("V" & r).Value = "Triangular"
End If
Next r

View 9 Replies View Related

Cleaning Up Code

Apr 15, 2007

It has been working perfectly from all sites but for some reason started to enter the wrong data once in a while?

Sub Macro8()
Application.StatusBar = "Updating Data from NOAA"
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("Web Data").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.srh.noaa.gov/ifps/MapClick.php?TempBox=1&HumidBox=1&Submit=Submit&FcstType=digital&textField1=32.74&textField2=-96.45&site=fwd&Radius=0&CiTemplate=0" _
, Destination:= Range("A15"))
.Name = _
"MapClick.php?TempBox=1&HumidBox=1&Submit=Submit&FcstType=digital&textField1=33.65&textField2=-95.54&site=fwd&Radius=0&CiTemplate=0_5"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False............................

View 7 Replies View Related

Getting Rid Of Spaces In Text Within Cells

Feb 14, 2014

I have a large spreadsheet that I need to take the spaces out within the text in each cell. Is there an excel function or macro that can do this? It would save me lots of time rather then having to go in manually and doing it!

View 3 Replies View Related

Trimming Cells (not Spaces)

Oct 20, 2008

Let's say in a cell i have the text ABCD/0123/01234 or ABC/0123/012345

How would i go about extracting whatever is inbetween the / ? i.e. 0123 in both examples?

View 14 Replies View Related

Removing Spaces From Cells?

Dec 29, 2011

I have a column of numbers that are in sets of 3. (123 456 789) I need to remove these spaces and just see 123456789.

View 3 Replies View Related

Superfluous Spaces In Cells

Dec 4, 2007

Public Function DSPACE(ByVal OCELL As String) As String
Dim sC As String
Dim i As Integer

For i = 1 To Len(OCELL)

sC = Mid(OCELL, i, 1)

If (sC >= "0" And sC <= "9") Or (sC >= "A" And sC <= "Z") Then
DSPACE = DSPACE + sC
End If

Next i
End Function

View 4 Replies View Related

Cleaning Up Phone Numbers With VBA

Aug 31, 2007

I am using VBA to enter customer information into a Microsoft SQL database. I have an excel sheet with thousands of customers listed. I will be using a While loop to process each line of the sheet. Part of the While loop needs to make any format changes necessary before the data moves over to the DB. So here is the issue:

How do I turn the following phone numbers:

(410) 273-9200
910-944-1232
276 623 4254
410 612 1100 Rob
(413) 786-1636 Cindy
1-800-783-4661
304) 842-5491 Sherry

Into a uniform layout? I would prefer ###-###-####

Each of the numbers above is an example from the list I have. There may be more variations (I have over 20 seperate lists to process, with over 10000 customers per list)

I imagine I need some process that will remove all character except numbers and then break the numbers up to add the hyphens back in at the appropriate places.

View 10 Replies View Related

Cleaning Address Data

Jun 24, 2008

I have a database of sales records containing 6 address columns (C-H). I want to extract the country (which may be entered in any of the 6 columns) and place this in a separate column. I have a definitive list of countries on sheet 2 which I have saved as a named range (Country).

I would like to be able to set something up which searches the six address fields on sheet 1 and if a match is found against the Country range, enter this in a separate column (I). A non-code solution would be ideal as I am nowhere near that level yet and want to be able to understand what I am doing as far as possible!

View 9 Replies View Related

Cleaning Up After Recording A Macro

May 15, 2007

I frequently use the record option to start off my macros. I realize this usually results in recorded events which are not absolutely necessary (recording a print macro is one that is full of excess line items). I then try and combine what I have recorded with what I have garnered from this wonderful website. If my spreadsheets are small - and I am not writing code to pass any inspections - is there a need to go back and clean up?

View 2 Replies View Related

Eliminating Spaces Within Text Cells

Jan 8, 2010

I have a formula that is dependent upon a column of cells containing text. Cells within this column randomly have an additional space (" ") following the words. With this invisible space, the formula doesn't work as intended.

Since I have an extremely long list of names, is there a way to easily remove additional spaces after words without manually going through each cell and deleting them?

View 9 Replies View Related

Combining Cells (strings With Spaces)

Nov 21, 2013

I have the below data that I need to concatenate, merge... I'm not sure.

The data looks like this currently:

So that it reads in one sentence, e.g. Northumberland; Newcastle; North Tyneside; South Tyneside (note - no "." or ";" at the end of the string).

I had come up with this formula -

=IF(A11>0,A11&"; ","")&IF(B11>0,B11&"; ","")&IF(C11>0,C11&"; ","")&IF(D11>0,D11&"; ","")&IF(E11>0,E11&"; ","")&IF(F11>0,F11&"; ","")&IF(G11>0,G11&"; ","")&IF(H11>0,H11&"; ","")&IF(I11>0,I11&"; ","")&IF(J11>0,J11&"; ","")&IF(K11>0,K11&"; ","")&IF(L11>0,L11&"; ","")&IF(M11>0,M11&"; ","")&IF(N11>0,N11&"; ","")&IF(O11>0,C11&"","")

Which works fine if there is a value in cell O, but if not, then a semi-colon appears at the end of the string. It also seems incredibly clunky.

Basically, I'm struggling (being a total n00b) to get the semi-colons in the right place, blank cells to be skipped or not included, and for there to be no semi-colon after the last value.

View 4 Replies View Related

Clear Spaces From Otherwise Empty Cells

Sep 23, 2008

I have a data table which has a mixture of text, blank cells, and cells with spaces in. I have created a pivot table from the data table. The pivot table is counting the cells with spaces in instead of reading them as blank. I have been able to fix this by putting on a filter in the data table, highlighing all the blank cells only and then clearing them column by column.

The problem is the data table is 50 columns long, so it is quite time consuming to do this manually. The data table gets updated regularly so this is an ongoing problem. Does anyone know of a faster solution to fix this problem? I have attached a snapshot of the problem as an example

View 4 Replies View Related

Combine Cells :: Without Spaces Or Commas Between Them

Oct 4, 2007

I Need To Combine 2 Fields Into 1 Field Without Spaces Or Commas Between Them.

View 4 Replies View Related

Trim Superfluous Spaces From Used Cells

Oct 25, 2007

I am working with a spreadsheet and rather new to be VBA. How do I select a range that only has data. I currently have the following macro, but when I run it, it checks every cell in the active worksheet which cause the application to hang. I would like it to automatically select only cells that have data in them ignoring all empty cells. I need this to be an automatically process running without the user selecting a range of data.

Here is my code ..

View 8 Replies View Related

Cleaning Up Data And Counting Words

Apr 26, 2014

However I have survey data results and in one of the cells it has multiple values which are separated between ; and some are not separated at all e.g B&Q; The Range; Wicks The Garden Shop

Also there are spelling mistakes everywhere and variation of the word B&Q e.g b+q, B n Q

I need to add count up all of the B&Q, Wicks etc...

View 7 Replies View Related

Cleaning Up Phone Number Lists?

Jun 22, 2014

I have an old customer list maintained by my company's previous owner in excel format that mostly stored numbers ###-#### format, but also some in ###-###-#### format.

My new list has always been maintained with numbers in (###) ###-#### format.

I have merged these two lists in a new excel file have begun the tedious process of cleaning up duplicates and bad data.

I have used conditional formatting to highlight duplicate numbers in the appropriate columns (L, M, N, O) in this case. However, it does't find matches in the other formats or perhaps the number with the old area code. I know the area code change could lead to false positives, but they should be minimal as this is a small business with mostly local customers. So what I'd like to find out is a formula for conditional formatting that will compare the last 8 characters in each cell (###-####) so as to eliminate issues of missing or different area codes. I would like it to check all of the columns for duplicate numbers not just within each column or within each row individually.

Also separate but related if possible to highlight a different color any cells with data not in any of these formats or if not in (###) ###-#### format if it's too much for all the formats.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved