Hello!

Sub Import_Text_To_Sheets()

Dim FilesToOpen
Dim x As Integer
Dim wkbAll As Workbook
Dim wkbTemp As Workbook
Dim sDelimiter As String

Application.ScreenUpdating = False

FilesToOpen = Application.GetOpenFilename _
(FileFilter:="Text Files (*.txt), *.txt", _
MultiSelect:=True, Title:="Text Files to Open")

If TypeName(FilesToOpen) = "Boolean" Then
MsgBox "No Files were selected"
End If

x = 1
Set wkbTemp = Workbooks.Open(Filename:=FilesToOpen(x))
wkbTemp.Sheets(1).Copy
Set wkbAll = ActiveWorkbook
wkbTemp.Close (False)

x = x + 1

While x <= UBound(FilesToOpen)
Set wkbTemp = Workbooks.Open(Filename:=FilesToOpen(x))
With wkbAll
wkbTemp.Sheets(1).Move After:=.Sheets(.Sheets.Count)

End With
x = x + 1
Wend

Application.ScreenUpdating = True

End Sub


with this code I import selected .txt files into separated excel sheets. Is there a possibilty to make all the files from .txt to be imported as "numbers" with decimal "," separator and not as "text" (error says that "numbers are stored as text")? Because all the small numbers are left aligned automaticaly (as text) and not as number as they should be.. All the numbers below 1,000 are automatically formated as text and numbers under 1 are as numbers but with . instead of ,


Thank you!

BR