Hi Jocky, try this option in VBA.
Sub ImportTXT() Dim DateTime As String '7 to 29 Dim CardHolder As String ' 33 to 49 Dim DoorZone As String ' 55 to 83 Dim Status As String ' 93 to 103 Dim nFile, rowTxt As String nFile = "C:\temp\1234.txt" 'change according to the way of your TXT file. Open nFile For Input As #1 Do While Not EOF(1) Line Input #1, rowTxt str1 = LTrim(rowTxt) If Mid(str1, 58, 1) = "-" Then DateTime = Mid(rowTxt, 7, 29 - 7 + 1) CardHolder = Mid(rowTxt, 33, 49 - 33 + 1) DoorZone = Mid(rowTxt, 55, 83 - 55 + 1) Status = Mid(rowTxt, 93, 103 - 93 + 1) Else End If Worksheets(1).Range("A" & Cells.Rows.Count).End(xlUp).Offset(1, 0).Value = DateTime Worksheets(1).Range("B" & Cells.Rows.Count).End(xlUp).Offset(1, 0).Value = CardHolder Worksheets(1).Range("C" & Cells.Rows.Count).End(xlUp).Offset(1, 0).Value = DoorZone Worksheets(1).Range("D" & Cells.Rows.Count).End(xlUp).Offset(1, 0).Value = Status Loop Close #1 End Sub 'Regards, 'Basole Em quarta-feira, 13 de novembro de 2013 06h11min45s UTC-2, jocky Beta escreveu: > > Hi Experts, > > Need help to convert Txt to Excel.Please find the Text file for referance > > Thanks in advance. > > Regards > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/groups/opt_out.