memeree
asked on
Create a Pipe Separated Log (like CSV) but pipes?, file using Excel VBA
Hi everyone,
i have the attached code from another answer....
It does what i want it to do, but i need it to place a pipe ' | ' between 'application.username' and 'now', and so on, and in doing so, create a formatted file that can be importable back by excel in the correct way ...
I'm hoping it should be simple, but you never know..
Many Thanks
i have the attached code from another answer....
It does what i want it to do, but i need it to place a pipe ' | ' between 'application.username' and 'now', and so on, and in doing so, create a formatted file that can be importable back by excel in the correct way ...
I'm hoping it should be simple, but you never know..
Many Thanks
Open ThisWorkbook.Path & "\usage.log" For Append As #1
Print #1, Application.UserName, Now, etc, etc, etc, .........
Close #1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm afraid I don't understand
why don;t you continue in the same vein , ie
Print #1, Application.UserName & "|" & Now() & "|" &"next" & "|" & "next2"
etc
Or are you actually asking how to convert a line of text
Print #1, Application.UserName, Now, etc, etc, etc,
into
Print #1, Application.UserName & "|" & Now & "|" & etc & "|" & etc & "|" & etc
automatically?
Cheers
Dave
why don;t you continue in the same vein , ie
Print #1, Application.UserName & "|" & Now() & "|" &"next" & "|" & "next2"
etc
Or are you actually asking how to convert a line of text
Print #1, Application.UserName, Now, etc, etc, etc,
into
Print #1, Application.UserName & "|" & Now & "|" & etc & "|" & etc & "|" & etc
automatically?
Cheers
Dave
ASKER
sorry, just realised how lazy i was being.
Control + H to replace all the commas with your suggestion above works perfectly.
Many Thanks
Control + H to replace all the commas with your suggestion above works perfectly.
Many Thanks
thx :)
ASKER
Is it possible to do this automatically? so that vba reads the commas on the second line as : & " | " & ?