Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default embed alignment in csv file

Does anyone know if there is a way to embed the alignment in a csv file so
that it aligns correctly when I open it in excel?
For instance If I create a csv file with '""01234""' the column will open as
an text field. I was hoping to do something like the same with aligning left
or right.
THank you,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 53
Default embed alignment in csv file

A CSV file only contains data, no formatting information. Excel will use the
general format for each column (texts are aligned left, numbers are aligned
right). What you could do is to have the first row of your file with the
alignment you need for each column, then run a short macro that would perform
alignment according to the instructions.

Sub AlignColumns()
' Align columns according to the text
' "left", "right", "center" in the first row

Dim i As Long

For i = 1 To 255
Select Case LCase(Cells(1, i))
Case "left"
Columns(i).HorizontalAlignment = xlLeft
Case "right"
Columns(i).HorizontalAlignment = xlRight
Case "center"
Columns(i).HorizontalAlignment = xlCenter
End Select
Next i

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 663
Default embed alignment in csv file

No.

It is not possible.

Challa Prabhu

"Abbey Normal" wrote:

Does anyone know if there is a way to embed the alignment in a csv file so
that it aligns correctly when I open it in excel?
For instance If I create a csv file with '""01234""' the column will open as
an text field. I was hoping to do something like the same with aligning left
or right.
THank you,

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default embed alignment in csv file

ok, thanks for the reply.

"challa prabhu" wrote:

No.

It is not possible.

Challa Prabhu

"Abbey Normal" wrote:

Does anyone know if there is a way to embed the alignment in a csv file so
that it aligns correctly when I open it in excel?
For instance If I create a csv file with '""01234""' the column will open as
an text field. I was hoping to do something like the same with aligning left
or right.
THank you,

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 embed an email in an excel file? Dan_man Excel Discussion (Misc queries) 0 September 26th 06 06:35 PM
is it possible to embed a font in an excel file? Gobbie Excel Discussion (Misc queries) 3 June 21st 06 11:52 AM
how do i embed a file in a workbook IAN C Excel Discussion (Misc queries) 2 April 28th 06 04:27 PM
How do I convert excel file into ASCII text file with alignment? Rosaiah Excel Discussion (Misc queries) 2 June 27th 05 12:17 PM
How do I embed a PDF file within Excel Eddy05 Excel Discussion (Misc queries) 1 January 25th 05 08:37 PM


All times are GMT +1. The time now is 12:28 AM.

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"