Hi,
I have the following code that gives me an error when I try to run it:
Sub MECToTXT()
Dim Data As Variant
Dim Filespec As String
Dim Rng As Range
Filespec = "C:\Users\B31090\Desktop\Logistikkhuset MEC.txt"
Set Rng = Range("H1:K1")
Set Rng = Range(Rng, Cells(Rows.Count, Rng.Column).End(xlUp))
Open Filespec For Output As #1
For Each Row In Rng.Rows
Data = Row.Value
Data = Application.Transpose(Data)
Data = Application.Transpose(Data)
Data = Application.Transpose(Data)
Print #1, """" & Data(1) & """ """ & Data(2) & """ """ & Data(3) & """ """ & Data(4) & """ """ & """"
Next Row
Close #1
Anyone here who can help me to write this code so that it will work properly? I have data in columns H1:K1 and downwards that I would like to have stored as a txt file as you probably see from the code.
Bookmarks