?
Solved

Create a Pipe Separated Log (like CSV) but pipes?, file using Excel VBA

Posted on 2009-07-14
5
Medium Priority
?
177 Views
Last Modified: 2012-05-07
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

Open ThisWorkbook.Path & "\usage.log" For Append As #1
Print #1, Application.UserName, Now, etc, etc, etc, .........
Close #1

Open in new window

0
Comment
Question by:memeree
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 50

Accepted Solution

by:
Dave Brett earned 2000 total points
ID: 24848359
like this ?

Open ThisWorkbook.Path & "\usage.log" For Append As #1
Print #1, Application.UserName & "|" & Now()
Close #1

Open in new window

0
 
LVL 3

Author Comment

by:memeree
ID: 24848483
close, but my problem is that i have around 50 different values on the print line; that ALL need to be separated by a pipe.

Is it possible to do this automatically? so that vba reads the commas on the second line  as : & " | " & ?
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 24848512
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

0
 
LVL 3

Author Closing Comment

by:memeree
ID: 31603209
sorry, just realised how lazy i was being.

Control + H to replace all the commas with your suggestion above works perfectly.

Many Thanks
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 24848555
thx :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question