How to embed a macro in a flat file?

C

calworld

I am creating a tab delimited file in UNIX environment. User use Excel
to view it. I need to run a macro so it will display correct page
break. However, I don't know how to embed the macro so the user will be
prompted to run the macro. Is there anyone that has an insight on how
to do it?
Thank you
-Cal
 
H

halimnurikhwan

hi,

record a macro by --- Tools > Macro > Record New Macro >
then press Alt + F11 then you'll in VBA session

I think you need to split the UNIX file into cells in excel ?!

rgds,

Halim

(e-mail address removed) menuliskan:
 
D

Dave Peterson

If you're creating a tab delimited text file (in any environment), then that
file will contain plain old text--no macros, no formulas, no formatting.

What I like to do is create a workbook that has a macro in it. It has one sheet
with a giant button on it that has has a macro assigned to it.

The macro prompts the user for the name of the file (if it can change) and then
imports that selected file.

In fact, the macro can continue doing nice things--freeze panes, filters,
headings, page headers and footers, save to a nice location with a nice name...

Most of this code can be obtained by recording a macro when you do it manually.
Then the minor modification to ask for the filename.

Then you send the user the macro workbook and they store it locally (or put it
somewhere everyone can get to--like a network drive).

And when you update your text file, you just tell them to use the macro workbook
to import the text file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top