ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to embed a macro in a flat file? (https://www.excelbanter.com/excel-programming/370867-how-embed-macro-flat-file.html)

[email protected]

How to embed a macro in a flat file?
 
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


[email protected]

How to embed a macro in a flat file?
 
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

menuliskan:
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



Dave Peterson

How to embed a macro in a flat file?
 
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.

wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com