HOW TO EXPORT TEXT FILE IN EXCEL USING VBA CODE 1st Insert module then copy past below code. Sub test() Dim myFile As String lr = Cells.Find("*", SearchDirection:=xlPrevious).Row Path = ActiveWorkbook.Path myFile = Path & "\aaa.txt" TextFile = FreeFile Open myFile For Output As TextFile For i = 1 To lr Print #TextFile, Range("A" & i).Value, Print #TextFile, Range("B" & i).Value Next Close #TextFile End Sub
Search This Blog
Coding Tree
Posts
Featured
Latest Posts
Excel Code : Editing for specific time period
- Get link
- X
- Other Apps