) as a valid decimal separator. The Val function recognizes only the period (. In windows operating system, the comma separator is decided in excel based on the Format selected.Value 'this will in most cases already convert to real numbers.'But if your numbers are hard coded to text and begin with a `'` you need the following additionally:If IsNumeric(.Value) Then 'can the value be interpreted as a number.Value = CDbl(. As decimal separator.Example: Val("2.55") 'will return 2.55 as numberVal("2,55") 'will return 2 as number (because it cuts off all text and the comma is not considered as decimal separator)To get rid of the green triangle and convert a number that is saved as text into a real number properly, use the following: Option ExplicitPublic Sub ConvertNumberAsTextIntoRealNumber()Set ws = ThisWorkbook.Worksheets("Hoja3")LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row.NumberFormat = "#0.00" 'set your desired number format.Value =.
0 Comments
Leave a Reply. |
Details
AuthorWendy ArchivesCategories |