Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Save file as Tilda Delimited without spaces or commas between colu

Good morning,

I am currently attempting to create a macro that will copy all the data from
an existing worksheet into a new workbook (this part I can do), and save as a
..csv file type (again this part I can do).

However, I would like to save the data in the worksheet to a file with no
delimiters between the columns. Could someone please suggest a method to
achieve this?

Thank you very much.

Regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Save file as Tilda Delimited without spaces or commas between colu

save it as a TAB separated file


"PVANS" wrote:

Good morning,

I am currently attempting to create a macro that will copy all the data from
an existing worksheet into a new workbook (this part I can do), and save as a
.csv file type (again this part I can do).

However, I would like to save the data in the worksheet to a file with no
delimiters between the columns. Could someone please suggest a method to
achieve this?

Thank you very much.

Regards

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Save file as Tilda Delimited without spaces or commas between colu

Try the below macro which will save the activesheet contents (Used range) to
a tilde delimited file.

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "~" & Trim(cell)
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Good morning,

I am currently attempting to create a macro that will copy all the data from
an existing worksheet into a new workbook (this part I can do), and save as a
.csv file type (again this part I can do).

However, I would like to save the data in the worksheet to a file with no
delimiters between the columns. Could someone please suggest a method to
achieve this?

Thank you very much.

Regards

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Save file as Tilda Delimited without spaces or commas between

Hi Jacob,

Thanks for the code. After initially running and testing it, I discovered
that it has created too many "~". I therefore edited your code like so:

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "" & Trim(cell) 'simply removed tilda from between
""
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub

This resulted in an almost perfect result. Unforetunately, I now am missing
a single "~" that should be appearing at the start of every row. Would you
have any suggestions on a code I could run to simply place a ~ at the start
of each row?

Once again, thanks for your assistance up to this point, and beyond

Regards

"Jacob Skaria" wrote:

Try the below macro which will save the activesheet contents (Used range) to
a tilde delimited file.

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "~" & Trim(cell)
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Good morning,

I am currently attempting to create a macro that will copy all the data from
an existing worksheet into a new workbook (this part I can do), and save as a
.csv file type (again this part I can do).

However, I would like to save the data in the worksheet to a file with no
delimiters between the columns. Could someone please suggest a method to
achieve this?

Thank you very much.

Regards

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Save file as Tilda Delimited without spaces or commas between

Try the below...

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
strData = "~"
For Each cell In rngRow.Cells
strData = strData & Trim(cell)
Next
Print #intFile, strData
Next
Close #intFile
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Hi Jacob,

Thanks for the code. After initially running and testing it, I discovered
that it has created too many "~". I therefore edited your code like so:

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "" & Trim(cell) 'simply removed tilda from between
""
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub

This resulted in an almost perfect result. Unforetunately, I now am missing
a single "~" that should be appearing at the start of every row. Would you
have any suggestions on a code I could run to simply place a ~ at the start
of each row?

Once again, thanks for your assistance up to this point, and beyond

Regards

"Jacob Skaria" wrote:

Try the below macro which will save the activesheet contents (Used range) to
a tilde delimited file.

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "~" & Trim(cell)
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Good morning,

I am currently attempting to create a macro that will copy all the data from
an existing worksheet into a new workbook (this part I can do), and save as a
.csv file type (again this part I can do).

However, I would like to save the data in the worksheet to a file with no
delimiters between the columns. Could someone please suggest a method to
achieve this?

Thank you very much.

Regards



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Save file as Tilda Delimited without spaces or commas between

Thanks Jacob,

Code worked brilliantly

Enjoy the rest of your day

"Jacob Skaria" wrote:

Try the below...

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
strData = "~"
For Each cell In rngRow.Cells
strData = strData & Trim(cell)
Next
Print #intFile, strData
Next
Close #intFile
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Hi Jacob,

Thanks for the code. After initially running and testing it, I discovered
that it has created too many "~". I therefore edited your code like so:

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "" & Trim(cell) 'simply removed tilda from between
""
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub

This resulted in an almost perfect result. Unforetunately, I now am missing
a single "~" that should be appearing at the start of every row. Would you
have any suggestions on a code I could run to simply place a ~ at the start
of each row?

Once again, thanks for your assistance up to this point, and beyond

Regards

"Jacob Skaria" wrote:

Try the below macro which will save the activesheet contents (Used range) to
a tilde delimited file.

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "~" & Trim(cell)
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Good morning,

I am currently attempting to create a macro that will copy all the data from
an existing worksheet into a new workbook (this part I can do), and save as a
.csv file type (again this part I can do).

However, I would like to save the data in the worksheet to a file with no
delimiters between the columns. Could someone please suggest a method to
achieve this?

Thank you very much.

Regards

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Save file as Tilda Delimited without spaces or commas between

You are welcome. Thanks for the feedback.

If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Thanks Jacob,

Code worked brilliantly

Enjoy the rest of your day

"Jacob Skaria" wrote:

Try the below...

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
strData = "~"
For Each cell In rngRow.Cells
strData = strData & Trim(cell)
Next
Print #intFile, strData
Next
Close #intFile
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Hi Jacob,

Thanks for the code. After initially running and testing it, I discovered
that it has created too many "~". I therefore edited your code like so:

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "" & Trim(cell) 'simply removed tilda from between
""
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub

This resulted in an almost perfect result. Unforetunately, I now am missing
a single "~" that should be appearing at the start of every row. Would you
have any suggestions on a code I could run to simply place a ~ at the start
of each row?

Once again, thanks for your assistance up to this point, and beyond

Regards

"Jacob Skaria" wrote:

Try the below macro which will save the activesheet contents (Used range) to
a tilde delimited file.

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "~" & Trim(cell)
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Good morning,

I am currently attempting to create a macro that will copy all the data from
an existing worksheet into a new workbook (this part I can do), and save as a
.csv file type (again this part I can do).

However, I would like to save the data in the worksheet to a file with no
delimiters between the columns. Could someone please suggest a method to
achieve this?

Thank you very much.

Regards

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Save file as Tilda Delimited without spaces or commas between

JustFYI..

http://www.microsoft.com/wn3/locales....htm#RateAPost

If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Thanks Jacob,

Code worked brilliantly

Enjoy the rest of your day

"Jacob Skaria" wrote:

Try the below...

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
strData = "~"
For Each cell In rngRow.Cells
strData = strData & Trim(cell)
Next
Print #intFile, strData
Next
Close #intFile
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Hi Jacob,

Thanks for the code. After initially running and testing it, I discovered
that it has created too many "~". I therefore edited your code like so:

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "" & Trim(cell) 'simply removed tilda from between
""
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub

This resulted in an almost perfect result. Unforetunately, I now am missing
a single "~" that should be appearing at the start of every row. Would you
have any suggestions on a code I could run to simply place a ~ at the start
of each row?

Once again, thanks for your assistance up to this point, and beyond

Regards

"Jacob Skaria" wrote:

Try the below macro which will save the activesheet contents (Used range) to
a tilde delimited file.

Sub SaveAsCustomDelimited()
Dim intFile As Integer, strData As String
Dim rngRow As Range, cell As Range

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
For Each cell In rngRow.Cells
strData = strData & "~" & Trim(cell)
Next
Print #intFile, Mid(strData, 2): strData = vbNullString
Next
Close #intFile
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Good morning,

I am currently attempting to create a macro that will copy all the data from
an existing worksheet into a new workbook (this part I can do), and save as a
.csv file type (again this part I can do).

However, I would like to save the data in the worksheet to a file with no
delimiters between the columns. Could someone please suggest a method to
achieve this?

Thank you very much.

Regards

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
Save as CSV: extra spaces around commas rjml Excel Discussion (Misc queries) 2 March 3rd 09 05:59 PM
tab delimited and commas sedonovan Excel Discussion (Misc queries) 0 July 31st 06 02:31 PM
How can I save a file as a comma-delimited text file in Excel? LAM Excel Discussion (Misc queries) 1 May 3rd 05 10:24 PM
save excel file from a table delimited file (.txt) using macros sedamfo New Users to Excel 1 February 15th 05 04:19 AM
Save .csv file. Decimals separated by commas belitre Excel Programming 2 May 10th 04 11:36 AM


All times are GMT +1. The time now is 10:17 PM.

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

About Us

"It's about Microsoft Excel"