Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Frank D. Nicodem, Jr.
 
Posts: n/a
Default Putting Excel formatting and/or formulas into CSV file

Is it possible to include any Excel formula or formatting information in a
CSV file?

I have numerous applications (typically written in SQL) that generate files
that I then use within Excel. To keep things simple, I've always just
generated the files as text files, in CSV format, so that they can be easily
imported into Excel.

However, I have two requirements that I would like to accomplish, and didn't
know if either were possible. The first is that I'd like to include some
basic formatting of the cells, when they are imported. I know I can do that
manually, when I import the file, but I was hoping to be able to do some
very minimal things (e.g., bolding text) by including some kind of
information within the CSV file itself. Thus, when the CSV file was
imported into Excel, those formatting features would already be in place.

The second requirement would be to find out if there is a way to include any
simple formulas in a CSV file. That might be, for example, to generate a
Sum in a particular cell, or perhaps even a percentage, or some other
calculation based on other information in the file. Is there any way at all
to "embed" formulas within a CSV file, such that they will be evaluated when
the CSV file is imported into Excel? Or is that purely something that
requires generating a complete XLS file?

BTW, if a CSV file is incapable of doing what I need, but anyone knows of
ANOTHER way to accomplish this, I'd be happy to know. Again, the
fundamental issue would be if there is any way to generate a file from an
external program (such as VB, SQL, or other application) which could be
imported into Excel, and already include formulas, or basic cell formatting.
----------------------------------------------------------
Frank Nicodem



  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

CSV files are plain text--they don't sort formatting.

If you store your formulas as text (and you're careful with your addressing),
excel will see them as formulas (if they start with an equal sign).

But I wouldn't do either of those.

I'd store my data as .txt

Then create a macro that opens that text file, applies the formatting, inserts
the formulas, and does other stuff (page setup, filters, sorts, pivottables,
etc).

Then use that macro whenever I wanted to bring in that .txt file.



"Frank D. Nicodem, Jr." wrote:

Is it possible to include any Excel formula or formatting information in a
CSV file?

I have numerous applications (typically written in SQL) that generate files
that I then use within Excel. To keep things simple, I've always just
generated the files as text files, in CSV format, so that they can be easily
imported into Excel.

However, I have two requirements that I would like to accomplish, and didn't
know if either were possible. The first is that I'd like to include some
basic formatting of the cells, when they are imported. I know I can do that
manually, when I import the file, but I was hoping to be able to do some
very minimal things (e.g., bolding text) by including some kind of
information within the CSV file itself. Thus, when the CSV file was
imported into Excel, those formatting features would already be in place.

The second requirement would be to find out if there is a way to include any
simple formulas in a CSV file. That might be, for example, to generate a
Sum in a particular cell, or perhaps even a percentage, or some other
calculation based on other information in the file. Is there any way at all
to "embed" formulas within a CSV file, such that they will be evaluated when
the CSV file is imported into Excel? Or is that purely something that
requires generating a complete XLS file?

BTW, if a CSV file is incapable of doing what I need, but anyone knows of
ANOTHER way to accomplish this, I'd be happy to know. Again, the
fundamental issue would be if there is any way to generate a file from an
external program (such as VB, SQL, or other application) which could be
imported into Excel, and already include formulas, or basic cell formatting.
----------------------------------------------------------
Frank Nicodem


--

Dave Peterson
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
Putting numbers in excel without it changing into a formula? RachaelDPT Excel Worksheet Functions 3 April 22nd 05 10:12 AM
Wrap text limits in Excel 2003 cell formatting Adelrose Excel Discussion (Misc queries) 1 April 19th 05 06:32 PM
excel formatting Lexicon Excel Discussion (Misc queries) 2 April 19th 05 06:23 PM
Excel: Additional Conditional Formatting gjarrett Excel Worksheet Functions 1 April 6th 05 05:30 PM
Excel Sort function should not sort the cell formatting! Lisa D.N.1 Excel Worksheet Functions 1 December 28th 04 08:37 PM


All times are GMT +1. The time now is 07:23 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"