Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with import files by excel macro
Hello,
I need to write/record a macro that takes multiple files(UNIX files)on the local computer and then copy all their content back to a sheet of the excel and then manipulate the data to generate a report. I particularly need help with macros that can import multiple files. I have come across an excel application whose button can prompt a windows and import ONE file to do similiar thing. However, what I want to do is more sophisticated. Do you have any idea?? do you have any resources from the web?? Thx!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with import files by excel macro
Raven,
here what I use for Excel files. You need to edit for you text files then "Open" and process each, or import in to Excel: <Code Response = Excel.Application.GetOpenFilename("HK Spec Files (*.xls), *.xls", , "Select the Spec Sheets to cost.", , True) On Error Resume Next 'As we have set MultiSelect=True, this will error if 1 (or more) files were selected. If Response < False Then 'Return to normal error handling On Error GoTo 0 'As we have set MultiSelect=True, an array of filenames will be returned even if only 1 file was selected, with LBound=1 FilesSelectedCount = UBound(Response) 'Loop through all selected files For FileCurrent = 1 To FilesSelectedCount 'Open the required Costs WB Set WBCosts = Workbooks.Open(Response(FileCurrent), , , ,) ...............Process Loop </Code "Raven" wrote in message oups.com... Hello, I need to write/record a macro that takes multiple files(UNIX files)on the local computer and then copy all their content back to a sheet of the excel and then manipulate the data to generate a report. I particularly need help with macros that can import multiple files. I have come across an excel application whose button can prompt a windows and import ONE file to do similiar thing. However, what I want to do is more sophisticated. Do you have any idea?? do you have any resources from the web?? Thx!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import all txt files macro | Excel Worksheet Functions | |||
problem with import files by excel macro | Excel Discussion (Misc queries) | |||
problem with import files by excel macro | Excel Discussion (Misc queries) | |||
Import CSV files using Macro | New Users to Excel | |||
Import multiple files macro can't find files | Excel Programming |