Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Format by VB opened Workbooks/sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Format by VB opened Workbooks/sheets

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
History of Workbooks opened derek Excel Worksheet Functions 1 May 20th 09 05:55 PM
Troubleshoot links - both workbooks have to be opened? JoyceM Excel Discussion (Misc queries) 0 February 7th 07 10:29 PM
always prompted to save opened workbooks kjbrr Excel Discussion (Misc queries) 2 July 31st 06 08:10 PM
How do you list all the workbooks you have opened and the sheets in each workbook? Wendy[_3_] Excel Programming 1 December 5th 03 09:17 PM
list of opened workbooks and selection Valeria[_2_] Excel Programming 3 December 4th 03 09:27 AM


All times are GMT +1. The time now is 10:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"