Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Okay, here we go:
The code I have written so far opens a range of workbooks selected by multi-select listbox and single-select listbox. Now I want to apply formatting to the opened workbooks, includin adding worksheets, setting autofilters sorting the data and then savin the workbooks as .xls files. Example: VB has opened files File1_a.csv, File1_b.csv and File1_c.csv from th first (multi select) listbox and File2_a.xls from the (single select listbox, so 4 files have been opened. Now I want to call function1 to format all open File1_*.csv files an copy-paste File1_*.csv ranges into different sheets of the File2_a.xl file. Function1 contains code as recorded in Excel. Can I declare/activate open workbooks by name (such as File1_*.csv) an then call the function on each individual open workbook meeting th file name criteria? I am eternally gratefull to anyone who can help me further on thi (last for my current project) vb problem! Thanks, Joos -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Based on the details provided,
Turn on the macro recorder open one of the CSV files. Perform all the required actions. Turn off the macro recorder. Adjust the recorded code to generalize it and compact it (remove unnecessary statements) -- Regards, Tom Ogilvy "exceller " wrote in message ... Okay, here we go: The code I have written so far opens a range of workbooks selected by a multi-select listbox and single-select listbox. Now I want to apply formatting to the opened workbooks, including adding worksheets, setting autofilters sorting the data and then saving the workbooks as .xls files. Example: VB has opened files File1_a.csv, File1_b.csv and File1_c.csv from the first (multi select) listbox and File2_a.xls from the (single select) listbox, so 4 files have been opened. Now I want to call function1 to format all open File1_*.csv files and copy-paste File1_*.csv ranges into different sheets of the File2_a.xls file. Function1 contains code as recorded in Excel. Can I declare/activate open workbooks by name (such as File1_*.csv) and then call the function on each individual open workbook meeting the file name criteria? I am eternally gratefull to anyone who can help me further on this (last for my current project) vb problem! Thanks, Joost --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
History of Workbooks opened | Excel Worksheet Functions | |||
Troubleshoot links - both workbooks have to be opened? | Excel Discussion (Misc queries) | |||
always prompted to save opened workbooks | Excel Discussion (Misc queries) | |||
How do you list all the workbooks you have opened and the sheets in each workbook? | Excel Programming | |||
list of opened workbooks and selection | Excel Programming |