HI
Can you help me?
This macro give me a error runtime 13 mismatch when the loop arrive to a blank cell
how can fix it?
i'm sorry for my english
Can you help me?
This macro give me a error runtime 13 mismatch when the loop arrive to a blank cell
how can fix it?
i'm sorry for my english
Code:
Sub saveText2()
Dim filename As String, lineText As String
Dim myrng As Range, i, j
filename = ThisWorkbook.Path & "\Command.txt"
Open filename For Output As [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL]
Set myrng = Range("M4:M120")
For i = 1 To myrng.Rows.Count
For j = 1 To myrng.Columns.Count
lineText = IIf(j = 1, "", lineText & ",") & myrng.Cells(i, j)
Next j
Print [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL] , lineText
Next i
Close [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL]
End Sub