Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Print the same page from many different named files

Dear all

I have a folder which includes 200 files of excel with exactly the same
format.
There is any possibility to make a macro in order to get into the folder and
print a specific sheet?
I.e Form file September print form all excel files the sheet named "IS"

Because it is quite difficult to open one by one the files and print one
sheet from each file. most times i am missing files or sheets.

Any help on that?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Print the same page from many different named files

Something like:

Sub a()
Dim FilePath As String
Dim FName As String
On Error Resume Next ''in case sheet does not exist
FilePath = "c:\Files\"
FName = Dir(FilePath & "*.xls")
While FName < ""
Workbooks.Open FilePath & FName
Worksheets("IS").PrintOut
ActiveWorkbook.Close False
FName = Dir()
Wend
End Sub


--
Jim Rech
Excel MVP
"Manos" wrote in message
...
| Dear all
|
| I have a folder which includes 200 files of excel with exactly the same
| format.
| There is any possibility to make a macro in order to get into the folder
and
| print a specific sheet?
| I.e Form file September print form all excel files the sheet named "IS"
|
| Because it is quite difficult to open one by one the files and print one
| sheet from each file. most times i am missing files or sheets.
|
| Any help on that?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Print the same page from many different named files

Hello Mr. Rech

Thank you very much for your help but i need a little more help.
Where i input the name of the sheet which i want to print?
And where i am running the code?
Soeey but my visual basic knowledge is not very good.

Thanks in advance manos

"Jim Rech" wrote:

Something like:

Sub a()
Dim FilePath As String
Dim FName As String
On Error Resume Next ''in case sheet does not exist
FilePath = "c:\Files\"
FName = Dir(FilePath & "*.xls")
While FName < ""
Workbooks.Open FilePath & FName
Worksheets("IS").PrintOut
ActiveWorkbook.Close False
FName = Dir()
Wend
End Sub


--
Jim Rech
Excel MVP
"Manos" wrote in message
...
| Dear all
|
| I have a folder which includes 200 files of excel with exactly the same
| format.
| There is any possibility to make a macro in order to get into the folder
and
| print a specific sheet?
| I.e Form file September print form all excel files the sheet named "IS"
|
| Because it is quite difficult to open one by one the files and print one
| sheet from each file. most times i am missing files or sheets.
|
| Any help on that?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Print the same page from many different named files

Hi again
another question. How or where i am going to run this code?
I have to do an add inn?

Regards Manos

"Jim Rech" wrote:

Something like:

Sub a()
Dim FilePath As String
Dim FName As String
On Error Resume Next ''in case sheet does not exist
FilePath = "c:\Files\"
FName = Dir(FilePath & "*.xls")
While FName < ""
Workbooks.Open FilePath & FName
Worksheets("IS").PrintOut
ActiveWorkbook.Close False
FName = Dir()
Wend
End Sub


--
Jim Rech
Excel MVP
"Manos" wrote in message
...
| Dear all
|
| I have a folder which includes 200 files of excel with exactly the same
| format.
| There is any possibility to make a macro in order to get into the folder
and
| print a specific sheet?
| I.e Form file September print form all excel files the sheet named "IS"
|
| Because it is quite difficult to open one by one the files and print one
| sheet from each file. most times i am missing files or sheets.
|
| Any help on that?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Print the same page from many different named files

This is the line that prints the worksheet:

Worksheets("IS").PrintOut

So change "IS" to whatever you need.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel and test it out via:
tools|macro|macros...



Manos wrote:

Hi again
another question. How or where i am going to run this code?
I have to do an add inn?

Regards Manos

"Jim Rech" wrote:

Something like:

Sub a()
Dim FilePath As String
Dim FName As String
On Error Resume Next ''in case sheet does not exist
FilePath = "c:\Files\"
FName = Dir(FilePath & "*.xls")
While FName < ""
Workbooks.Open FilePath & FName
Worksheets("IS").PrintOut
ActiveWorkbook.Close False
FName = Dir()
Wend
End Sub


--
Jim Rech
Excel MVP
"Manos" wrote in message
...
| Dear all
|
| I have a folder which includes 200 files of excel with exactly the same
| format.
| There is any possibility to make a macro in order to get into the folder
and
| print a specific sheet?
| I.e Form file September print form all excel files the sheet named "IS"
|
| Because it is quite difficult to open one by one the files and print one
| sheet from each file. most times i am missing files or sheets.
|
| Any help on that?




--

Dave Peterson

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
Saving Excel 2010 files as web page or single file web page Joe Artis Excel Discussion (Misc queries) 3 April 29th 23 03:44 AM
how do you print single page multiply times with increasing page . aliasmith Excel Worksheet Functions 2 September 26th 08 12:30 AM
Setting the print area in page set up to print 1 page wide by 2 pages tall EA[_2_] Excel Discussion (Misc queries) 2 July 12th 07 08:39 PM
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM
a for selected sheets print named page macro Todd Excel Programming 1 July 22nd 04 12:25 AM


All times are GMT +1. The time now is 12:55 PM.

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

About Us

"It's about Microsoft Excel"