• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Convert numbers stored as text to numbers

Shay A

Member
Hello,
A direction to such a code would wonderful. I searched this forum prior to asking, just wasn't sure I found what I was looking for...

Thanks!
 
Is this a followup to another post?

If so please ask the question there

If not, Can you please ask the question here?
 
You need to better explain your situation

If you have a column of Text that is numbers simply multiplying the values by 1 will convert them to numbers

Can you post a sample file ?
 
I am familiar with this method, looking for a macro to do it automatically. I have many files with this issue.

TY
 

Attachments

  • numbers as text.xlsm
    8.1 KB · Views: 5
upload_2016-8-20_15-36-56.png

Mr. hui,

Can you help me for the same,
i want condition formula.
I m not able to make this formula, error showing many argument use.

Thanks
Manish Kumar Gupta
 
Depends.
If no formula used.
Code:
Sub test()
    With ActiveSheet.UsedRange
        .NumberFormat = ""
        .Value = Evaluate("if(isnumber(" & .Address & ")," & .Address & "*1,if(" & .Address & "<>""""," & .Address & ",""""))")
    End With
End Sub
Otherwise you need to loop.
 
View attachment 33798

Mr. hui,

Can you help me for the same,
i want condition formula.
I m not able to make this formula, error showing many argument use.

Thanks
Manish Kumar Gupta
Hi ,

This question has nothing to do with this thread ; can you please post this question in a new thread of your own ?

If possible , give more details of what your data is like , and what you would like to do , and upload a workbook with adequate real-life data.

Narayan
 
Hello,
how do I change this code so it converts numbers stored as numbers to numbers stored as text?

Sub test()
With Columns(1)
.NumberFormat = ""
.TextToColumns
End With
End Sub


Thanks!
 
Hi ,

The With specifies only column A ; if you want multiple ranges to be covered in this macro , please specify all of them in this thread , or even better , upload your workbook with the data in it. The macro will have to be revised , since these multiple ranges cannot be covered in the With clause.

Narayan
 
Hi,
further to the lovely code you provided me, is there a way to create a loop to convert all numbers stored as text to numbers with the format
.NumberFormat = ""
However, if there are already numbers on the sheet that are stored as numbers, the code will not change their formatting.

Thanks again,
Shay
 
Back
Top