View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
Paul H[_2_] Paul H[_2_] is offline
external usenet poster
 
Posts: 55
Default Load a CSV into an empty, formatted XLS?


I tried it using Excel 2003 and it works there also. I'll try the entire
process tomorrow (Monday). Wish me luck, and thanks.
Paul

================================================== =======

"JLatham" wrote in message
...
In Excel 2007 you will need to be able to see the [Developer] tab. If it is
not visible now, click the Office Button, then the [Excel Options] button
near the lower right of the window that opens. In the "Popular" group,
enable the "Show Developer tab in the ribbon" option.
To record a macro, choose the Developer tab and click the "Record Macro" -
give it a name and procede with the steps you wish to record. The "Record
Macro" option will have changed to "Stop Recording". Click it when you have
finished recording the steps you need to repeat later.

"Paul H" wrote:


================================================== =======

How do I record a macro? Do you mean I can create a macro that will do my
steps 1 thru 8, below?

================================================== =======
"Dave Peterson" wrote in message
...
It's too difficult to push a button?

If that's true, then name your macro Auto_Open. It'll run the first time
someone opens the workbook. You could plop the date into a cell in a
hidden
sheet so that it only runs once. And add a save at the end.

If that doesn't work, good luck with the automation.

Paul H wrote:

================================================== =======
I need the COBOL program to properly format the data. Multiple
end-users
will use this, sometimes daily, with data that changes daily, so I have
been
requested to make it completely automatic. Another subsequent program
shows
them the choices of reports and automatically starts the one they
select.

================================================== =======


"Dave Peterson" wrote in message
...
Maybe you could drop the requirement that the COBOL program do it.

Set up a workbook with two sheets (instructions for the user and the
actual
data).

Record a macro that does all the work in the second sheet.

The plop a button from the Forms toolbar onto the instruction sheet that
calls
that macro.

You only have to rename the worksheet if you're doing File|Open (or the
equivalent in code). If you use the import external data stuff, you can
leave
it named .csv.

================================================== =======

Paul H wrote:

Thanks Dave,

I used your "import text" method and it does succeed in importing my
.CSV
file into my empty .XLS file, in about 2 seconds. That is, after I
manually:

1. Open empty XLS file.
2. Data, import external data, import data.
3. "Select Data Source" screen comes up.
4. Type in my xxxx.TXT file name.
5. Import wizard step 1 - select delimited, then next.
6. Import wizard step 2 - select only Comma, then finish.
7. Import data to existing worksheet.
8. It imports the entire file in about 2 seconds, formatted correctly,
with
columns as described in my empty .XLS file.

Now I need to figure out how to accomplish these steps automatically
by
my
COBOL program.

Thanks again,
Paul

================================================== =======
"Dave Peterson" wrote in message
...
If you rename the .csv file to .txt, you may be able to import the
file
quicker
by setting each field the way you want.

Then you could format the numeric fields as percentages or whatever
you
needed.

If you have fields that have implicit decimals, you could import them
as
Generals and then put a factor of 10 (10, 100, 1000, ...) in an empty
cell.
Edit|copy, edit|paste special|Values and divide (all in code) to
convert
that
field.
================================================== =======
Paul H wrote:

I have an empty, formatted spreadsheet, that I created by writing a
few
rows
into it from my COBOL program, field by field, then deleting all of
the
rows.

The process of creating the entire XLS or XLSX runs much too slow
(100
records per minute or less), and uses memory up, so can never allow
me
to
finish converting some of my large CSV files into formatted XLS
(Excel
2003)
or XLSX (Excel 2007) files. Someone told me to "turn off continual
re-calculating". How?

I wonder if I can somehow import my large .CSV file into my .XLS
empty
formatted file? I cannot find a way. Any help would be
appreciated.

TIA, Paul

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson