[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


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

Posted on 2009-07-14
Medium Priority
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

Question by:memeree
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
LVL 50

Accepted Solution

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


Author Comment

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 : & " | " & ?
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"

Or are you actually asking how to convert a line of text
Print #1, Application.UserName, Now, etc, etc, etc,
Print #1, Application.UserName   & "|" & Now  & "|" & etc  & "|" & etc  & "|" & etc



Author Closing Comment

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
LVL 50

Expert Comment

by:Dave Brett
ID: 24848555
thx :)

Featured Post

Industry Leaders: 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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

650 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