Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Export from Excel using alternative delimiters

Hi all,

I need to export from Excel a large table in text format, and I cannot
use
either tab or comma.
I am aware of these solutions:
1- http://www.cpearson.com/excel/imptext.htm#Export (which kind-of-
works
but has a problem with size);
2- changes in regional settings (problem with impact on other lists,
etc.)

Preferably I would like to use a column delimiter ALT-028 and a row
delimiter ALT-030 (both invisible and cannot be typed).
Is there a solution to this problem?

I do not use Excel often and I do not know VBA programming, and since
this
is a one time issue, I cannot afford to learn it now.
This is why I am addressing the experts in this group.
I believe my problem should be common enough to have been solved by
now.
"There is no solution to this problem" is also an acceptable answer, I
just
need to know.

Many thanks in advance,
- Mike Ov.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Export from Excel using alternative delimiters

Try something like this:

Sub StringToTextFile(ByVal txtFile As String, _
ByVal strString As String)

Dim hFile As Long

hFile = FreeFile

'Close before reopening in another mode.
'---------------------------------------
On Error Resume Next
Open txtFile For Input As hFile
Close #hFile

Open txtFile For Output As hFile
'Write #hFile, strString 'this will make start- and end quotes
Print #hFile, strString;
Close #hFile

End Sub

Sub Range2Text(rng As Range, _
strFile As String, _
Optional strColumnDelimiter As String = ",", _
Optional strRowDelimiter As String = vbCrLf)

Dim r As Long
Dim c As Long
Dim arr
Dim UB1 As Long
Dim UB2 As Long
Dim str As String

arr = rng

UB1 = UBound(arr)
UB2 = UBound(arr, 2)

For r = 1 To UB1
If r = 1 Then
For c = 1 To UB2
If c = 1 Then
str = arr(r, c)
Else
str = str & strColumnDelimiter & arr(r, c)
End If
Next c
Else
For c = 1 To UB2
If c = 1 Then
str = str & arr(r, c)
Else
str = str & strColumnDelimiter & arr(r, c)
End If
Next c
End If
str = str & strRowDelimiter
Next r

StringToTextFile strFile, str

End Sub


Sub test()

Range2Text Range(Cells(1), Cells(3, 3)), "C:\Test.txt"

End Sub


Not sure now how to tell VBA you want ALT-028 and ALT-030, but that should
be simple and you
probably know.


RBS


wrote in message
ps.com...
Hi all,

I need to export from Excel a large table in text format, and I cannot
use
either tab or comma.
I am aware of these solutions:
1- http://www.cpearson.com/excel/imptext.htm#Export (which kind-of-
works
but has a problem with size);
2- changes in regional settings (problem with impact on other lists,
etc.)

Preferably I would like to use a column delimiter ALT-028 and a row
delimiter ALT-030 (both invisible and cannot be typed).
Is there a solution to this problem?

I do not use Excel often and I do not know VBA programming, and since
this
is a one time issue, I cannot afford to learn it now.
This is why I am addressing the experts in this group.
I believe my problem should be common enough to have been solved by
now.
"There is no solution to this problem" is also an acceptable answer, I
just
need to know.

Many thanks in advance,
- Mike Ov.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Export from Excel using alternative delimiters

Mike

Earl Kiosterud's free TEXTWRITE add-in may do what you want.

http://www.smokeylake.com/excel/text_write_program.htm


Gord Dibben MS Excel MVP




On 3 May 2007 12:10:41 -0700, wrote:

Hi all,

I need to export from Excel a large table in text format, and I cannot
use
either tab or comma.
I am aware of these solutions:
1-
http://www.cpearson.com/excel/imptext.htm#Export (which kind-of-
works
but has a problem with size);
2- changes in regional settings (problem with impact on other lists,
etc.)

Preferably I would like to use a column delimiter ALT-028 and a row
delimiter ALT-030 (both invisible and cannot be typed).
Is there a solution to this problem?

I do not use Excel often and I do not know VBA programming, and since
this
is a one time issue, I cannot afford to learn it now.
This is why I am addressing the experts in this group.
I believe my problem should be common enough to have been solved by
now.
"There is no solution to this problem" is also an acceptable answer, I
just
need to know.

Many thanks in advance,
- Mike Ov.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting pdf to excel, no delimiters smartgal Excel Discussion (Misc queries) 4 May 1st 08 05:08 PM
How to Export as text file with NO delimiters or modifications? MojoNixon Excel Discussion (Misc queries) 5 August 15th 06 09:37 PM
How can I assign delimiters to an excel web query? Desperate Dan Excel Discussion (Misc queries) 1 March 17th 06 04:13 PM
How can I assign delimiters to an excel web query? Desperate Dan Excel Discussion (Misc queries) 0 March 16th 06 03:25 PM
Export (or save as) .csv with text delimiters CarolineP Excel Discussion (Misc queries) 2 February 17th 05 02:25 AM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"