Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Check Work Books

Hi Gary

First off I want to apologize for listing this in two places. When I was
placing it I thought I was in the Excel Programming section but was only when
I went looking for replys that I discovered my error. I did not know if
people responding in the Excel section would see it. Sorry;

As far as your suggestion it runs, however I get a message box that says:
HAS 26 SHEETS AND CONTINUES TO LOOP UNTIL I HIT THE EXCAPE KEY.

Any suggestions?

"Gary''s Student" wrote:

Create a workbook and in column A put the filespecs:

C:\Temp\first.xls
C:\Temp\second.xls

basically a list of all the files you wish to check. Then run this:

Sub checkUm()
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
v = Cells(i, 1).Value
Workbooks.Open Filename:=v
n = ActiveWorkbook.Sheets.Count
If n 1 Then
MsgBox v & " has " & n & " sheets"
End If
ActiveWorkbook.Close
ThisWorkbook.Activate
Next
End Sub

B.T.W. this illustrates the difference between ActiveWorkbook and
ThisWorkbook.
--
Gary''s Student - gsnu201001


"Beep Beep" wrote:

I have around 100 Excel work books. In the original there are 3 worksheets.
I copy the one worksheet for each person into a new workbook in order to send
this to each individual.

What I would like to do is create a macro that I could run automatticaly
with all 100 individual workbooks to insure that there is only 1 worksheet on
these individual workbooks.

What I forsee is that I would have this macro in my personal workbook and
after opening all 100 workbooks then run the macro to check this workbooks.

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
data from many work books Sandeep S. New Users to Excel 2 November 23rd 09 05:07 PM
formula to work in a 3-d reference with 2 work books capt c Excel Worksheet Functions 1 April 8th 09 08:04 PM
need a function that will work using multiple work books and sheet capt c Excel Worksheet Functions 1 March 30th 09 10:20 PM
Counting dates in multiple work sheets and work books Savage Excel Discussion (Misc queries) 0 December 19th 05 11:41 PM
Work books shell4923 Excel Worksheet Functions 1 March 29th 05 04:28 PM


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"