View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] dhara5283@gmail.com is offline
external usenet poster
 
Posts: 3
Default Importing .PRN files into Excel spreadsheet

Thank you so much for your help.... It works fine..

Once again Thanks.

Dave Peterson wrote:
I like to create a dedicated macro workbook that contains the code. And then I
put a big button from the Forms toolbar on the only worksheet in that workbook.
I'll add a few instructions to that sheet, too.

I'd tweak the code to get the name of the file to open from the user and then
include code that adds some more stuff--like formatting, filters, subtotals,
page setup (headers/footers/rows to repeat at top/etc).

Then it actually becomes a tool that makes life a lot easier.

My tweaked code could look a little like:

Option Explicit
Sub Testme01()

Dim myFileName As Variant

myFileName = Application.GetOpenFilename(filefilter:="Prn Files, *.PRN", _
Title:="Pick a File")

If myFileName = False Then
MsgBox "Ok, try later" 'user hit cancel
Exit Sub
End If

Workbooks.OpenText Filename:=myFileName '....rest of recorded code here!

End Sub

wrote:

Is there a way to import .PRN files into Excel Spreadsheet
automatically? I have tried recording macros and then tried to save it.
it did not work. I want to set up a button where you can just click it
and it will let you open .PRN files and then does everything
automatically.

Much appreciated!
-DR


--

Dave Peterson