Sub WriteSales To Text() Dim txtFile As String Dim row As String, column As String Dim nRows As Integer, nColumns As Int

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Sub WriteSales To Text() Dim txtFile As String Dim row As String, column As String Dim nRows As Integer, nColumns As Int

Post by answerhappygod »

Sub Writesales To Text Dim Txtfile As String Dim Row As String Column As String Dim Nrows As Integer Ncolumns As Int 1
Sub Writesales To Text Dim Txtfile As String Dim Row As String Column As String Dim Nrows As Integer Ncolumns As Int 1 (78.6 KiB) Viewed 26 times
Sub WriteSales To Text() Dim txtFile As String Dim row As String, column As String Dim nRows As Integer, nColumns As Integer Dim dataLine As String Substitute the appropriate path and filename in the next line. txtFile = "C:\Temp\Sales.txt" Open txtFile For Output As #1 With wsSales.Range("A1") = nRows Range(.Offset(0, 0), .End(xIDown)).Rows.Count nColumns = Range(.Offset(0, 0), .End(xlToRight)).Columns.Count For now 1 To nRows 'Build data line from data in this wor, separate by tabs. dataLine dataLine & .Cells(rows, column).Value For column=1 To nColumns = End Sub Next End With Close #1 dataLine = dataLine & .Cells(rows, column).Value Don't add a tab after the last piece of data in the row. If column
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply