Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using ascii values

Status
Not open for further replies.

mscallisto

Technical User
Jun 14, 2001
2,990
US
I need to create a text file that surrounds each cell's values with tilde's and separated them with a tab.

my example below currently separates the fields with "|"
what's the syntax to change the "|" with a tab (ascii 13) value



For r = 1 To .Rows.Count
For c = 1 To .Columns.Count - 1
Print #1, "~"; .Cells(r, c); "~"; "|";
Next c
Print #1, .Cells(r, .Columns.Count)
Next r
 
hi,
Code:
Print #1, "~"; .Cells(r, c); "~"; chr(13);


Skip,
[sub]
[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue][/sub]
 
Thanks Skip, I just had a brain cramp, I tried to think and nothing was happening. I tried the thread search, but it's having a cramp fixed too!
 
m,

cramp happens! ;-)

Skip,
[sub]
[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue][/sub]
 
Actually I believe I needed an ascii(009) Horizontal Tab, the same tab you get if you save as tab delimited.

still cramping!
 
Hi mscallisto,

And Chr(9) doesn't work?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
13 is CR

Skip,
[sub]
[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue][/sub]
 
Tab is Chr(9) aka vbTab

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes Tony chr(9) works (like I said I was cramping) I simply took the 009 from an extended ascii chart where I was checking the value for Horizontal vs Verticle tab.

and

Thanks PH I always forget the vbComands
... if vbTab is horiz tab is there a vert tab also?
 
if vbTab is horiz tab is there a vert tab also
vbVerticalTab is Chr(11)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top