Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
LMI LMI is offline
external usenet poster
 
Posts: 9
Default CRLF in .cvs file

I have an export format coming over from my hand help device that is coming
over in .csv when i open it up in excel my format is as follows:
date,time,value,shift
date, time,value,shift
date,time,value,shift
date,time value shift

How i need it to come over is this way:
date,time,value,shift[]date,time,value,shift[],date,time,value,shift.......

The[]is the CRLF how can i set the above format up running an excel macro?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default CRLF in .cvs file

LMI,

You could use a macro: Select the cells, and run this.

Sub CombineMacro()
Dim myCell As Range
Dim myVal As String

Selection.EntireColumn.AutoFit

myVal = Selection.Cells(1).Value

For Each myCell In Selection.Offset(1).Resize(Selection.Rows.Count - 1)
myVal = myVal & Chr(10) & myCell.Value
Next myCell

Selection.ClearContents
Selection.Cells(1).Value = myVal
Selection.Cells(1).WrapText = True

End Sub

HTH,
Bernie
MS Excel MVP


"LMI" wrote in message
...
I have an export format coming over from my hand help device that is coming
over in .csv when i open it up in excel my format is as follows:
date,time,value,shift
date, time,value,shift
date,time,value,shift
date,time value shift

How i need it to come over is this way:
date,time,value,shift[]date,time,value,shift[],date,time,value,shift.......

The[]is the CRLF how can i set the above format up running an excel macro?



  #3   Report Post  
Posted to microsoft.public.excel.programming
LMI LMI is offline
external usenet poster
 
Posts: 9
Default CRLF in .cvs file

"4/5/2006
4/5/2006
0.475509259259259
18952
7.86072
7.86072
7.86072
7.86072
4/5/2006
0.475543981481481
18952
7.86072
7.86072
7.86072
7.86072",
,
,

This works real good but how can i get the " and the extra ,, at te end off
the file?
Also how do i get my date 5 values and then have a CRLF then data again 5
values and CRLF ???




"Bernie Deitrick" wrote:

LMI,

You could use a macro: Select the cells, and run this.

Sub CombineMacro()
Dim myCell As Range
Dim myVal As String

Selection.EntireColumn.AutoFit

myVal = Selection.Cells(1).Value

For Each myCell In Selection.Offset(1).Resize(Selection.Rows.Count - 1)
myVal = myVal & Chr(10) & myCell.Value
Next myCell

Selection.ClearContents
Selection.Cells(1).Value = myVal
Selection.Cells(1).WrapText = True

End Sub

HTH,
Bernie
MS Excel MVP


"LMI" wrote in message
...
I have an export format coming over from my hand help device that is coming
over in .csv when i open it up in excel my format is as follows:
date,time,value,shift
date, time,value,shift
date,time,value,shift
date,time value shift

How i need it to come over is this way:
date,time,value,shift[]date,time,value,shift[],date,time,value,shift.......

The[]is the CRLF how can i set the above format up running an excel macro?




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
How do I get SQL data to show CRLF instead of question marks? Number2 Excel Discussion (Misc queries) 0 November 15th 09 05:15 AM
Cut and Paste Text with CRLF into Single Cell Jim Excel Discussion (Misc queries) 1 January 10th 08 08:57 PM
Making tab do a CRLF when reaching end of a range John A Excel Discussion (Misc queries) 3 May 10th 07 02:13 AM
HELP - How to replace CRLF with a character withing an excel column Dino Buljubasic Excel Discussion (Misc queries) 1 August 25th 05 07:49 PM
CRLF in text box Neil Miller[_2_] Excel Programming 5 January 7th 04 03:14 PM


All times are GMT +1. The time now is 02:47 AM.

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"