2 Attachment(s)
convert the data from .xlsx to .txt file: Export Excel cell values to delimeted text File
1 Attachment(s)
Macro Correction converting data from .xlsx to notepad
Hi,
I have a macro that converts the data from .xlsx to notepad But there is some issue with the notepad data, sometimes my system reads it & sometimes not bcoz the data may have issues like in notepad the data may be as value or the data will
have different format data Or it can be xyz issue
I am sending the notepad file which i downloaded from system & system accept that type of notepad files & reads all the data of notepad files , so plz see the system notepad file & correct the macro according to that , the data which this macro creates should be exact same to same format or types ,i dont know what is the exact issue
Code:
Sub STEP24()
Dim wb1 As Workbook
Set wb1 = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\HotStocks\Alert.xlsx")
Dim ws1 As Worksheet: Set ws1 = wb1.Worksheets.Item(1)
Dim lr As Long, Lc As Long
Let lr = ws1.Cells.Range("A" & ws1.Rows.Count & "").End(xlUp).Row
Let Lc = ws1.Cells.Item(1, ws1.Columns.Count).End(xlToLeft).Column
Dim arrIn() As Variant: Let arrIn() = ws1.Range(ws1.Range("A1"), ws1.Cells.Item(lr, Lc)).Value
Dim Rw As Long, Clm As Long '
For Rw = 1 To lr
For Clm = 1 To Lc
Dim strTotalFile As String
Let strTotalFile = strTotalFile & arrIn(Rw, Clm) & ","
Next Clm
Let strTotalFile = Left(strTotalFile, Len(strTotalFile) - 1)
Let strTotalFile = strTotalFile & vbLf
Next Rw
Let strTotalFile = Left(strTotalFile, Len(strTotalFile) - 1)
Debug.Print strTotalFile
Dim FileNum As Long
Let FileNum = FreeFile(1)
Open "C:\Users\WolfieeeStyle\Desktop\Alert..txt" For Output As #FileNum
Print #FileNum, strTotalFile
Close #FileNum
wb1.Close
End Sub
Alert.txt is the system data
https://www.excelforum.com/excel-pro...o-notepad.html