Question: my task is:

1) Select all cells in A row which contain values (done).
2) Text to Columns - example value 2017.01.01

```
Sub selectAndToColumns()
    Dim LR As Long
    LR = Range("A" & Rows.Count).End(xlUp).Row
    Range("A1:A" & LR).SpecialCells(xlCellTypeConstants, 23).Select
'2nd step
    Selection.TextToColumns Destination:=Range(A1), DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
    Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
    :=".", FieldInfo:=Array(Array(1, 2), Array(2, 1), Array(3, 1))
End Sub

```

1 step is ok, but how can I use my selection instead of Range(A1) in 2nd step? Can I make a variable and how?

Answer: 
```
def do_input():
    user_input = input("Input a number: ")
    try:
        num = int(user_input)
    except ValueError:
        try:
            num = float(user_input)
        except ValueError:
            print("You didn't input a number")
            num = None
    return num

for _ in range(3):
    a = do_input()
    print("Now your number is", a, "and its type is" , type(a))

```

Output:

```
Input a number: 3
Now your number is 3 and its type is <class 'int'>
Input a number: 2.1
Now your number is 2.1 and its type is <class 'float'>
Input a number: ij
You didn't input a number
Now your number is None and its type is <class 'NoneType'>

```
`eval` function does not really parse given string as number. It [evaluates string as a python expression](https://docs.python.org/2/library/functions.html#eval).

So the fact that `eval('2')` gives 2 is just a coincidence, because 2 is correct python expression that evaluates to number. 

So you shouldnt use `eval` to parse strings as numbers. Instead simply try parsing (con verting) it as integer, float and Decimal (in this order) and if you don't get error in any of your tries it means this is correct number of specified type. 

Answer posted by @jose-a shows how could it be done.