Whenever I try and paste data into an excel spreadsheet I get the number as text error in every column that has a number in it. After researching the issue I found some code that does go through the columns and formats them into a number, but the code goes into an endless loop. What can I add to the code to make it stop once the loop has gone through any cell with something in it?
Code:
Sub ConvertToDouble()
'Converts numbers stored as text to type Double
Dim cell As Range
For Each cell In Selection
If Not IsEmpty(cell) And IsNumeric(cell.Value) Then
cell.Value = CDbl(cell.Value)
End If
Next cell
End Sub