Remove special characters from Huge Data

santoshloka

Board Regular
Joined
Aug 31, 2017
Messages
125
I have seen this type of characters "<>$-* and gaps between values
456.789-
*568.658
--etc
I need only values like this 425.368
rest of the special charecters need to remove
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Re: how to remove specal characters from Huge Data?

I have seen this type of characters "<>$-* and gaps between values
456.789-
*568.658
--etc
I need only values like this 425.368
rest of the special charecters need to remove
I presume you want a macro. In order to write one, we need to know where the values you want parsed are located... what column or columns and starting at which row.
 
Upvote 0
Re: how to remove specal characters from Huge Data?

A2:A500
B2:B500
C2:C500
sheet1

If possible i want them in calibri and table box for that,size 12,wrap it and set it to center
 
Last edited:
Upvote 0
Re: how to remove specal characters from Huge Data?

A2:A500
B2:B500
C2:C500
sheet1

If possible i want them in calibri and table box for that,size 12,wrap it and set it to center
I do not know what you mean by "table box" nor can I see any reason to set Word Wrap on for a simple number in a cell, so I did not do either of those in this code. With that said, give this macro a try...
Code:
Sub RemoveSpecialCharacters()
  Dim R As Long, C As Long, X As Long, Data As Variant
  Data = Range("A2:C500")
  For R = 1 To UBound(Data, 1)
    For C = 1 To UBound(Data, 2)
      For X = 1 To Len(Data(R, C))
        If Mid(Data(R, C), X, 1) Like "[!0-9.]" Then Mid(Data(R, C), X) = " "
      Next
      Data(R, C) = Replace(Data(R, C), " ", "")
    Next
  Next
  With Range("A2:C500")
    .Value = Data
    .Font.Name = "Calibri"
    .Font.Size = 12
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlCenter
  End With
End Sub
 
Upvote 0
Re: how to remove specal characters from Huge Data?

in A1,B1,C1 column i have some text, it need to be wrap
table box nothing but all borders
 
Upvote 0
Re: how to remove specal characters from Huge Data?

in A1,B1,C1 column i have some text
:confused: I thought you only had numbers with extra characters and wanted just the numbers. Obviously, then, my code won't work for you as written. Can you show us several representative examples of the kinds of values that will be in those cells (vary their content as much a possible)? What I am concerned about is the "special symbols" (like dashes, commas) in the non-numeric parts of your values and not having my code delete them while removing them from the number part of the text. I am also interested if more than one number that needs treatment could be in a single cell.
 
Upvote 0
Last edited:
Upvote 0
Re: how to remove specal characters from Huge Data?

In your data you have items like "591.9."
Since your final values can have decimal points (according to your example in post 1), how do know if the above example should be
591.9
or
5919
 
Upvote 0
Re: how to remove specal characters from Huge Data?

In your data you have items like "591.9."
Since your final values can have decimal points (according to your example in post 1), how do know if the above example should be
591.9
or
5919

Its 591.9
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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