Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
data from many work books | New Users to Excel | |||
formula to work in a 3-d reference with 2 work books | Excel Worksheet Functions | |||
need a function that will work using multiple work books and sheet | Excel Worksheet Functions | |||
Counting dates in multiple work sheets and work books | Excel Discussion (Misc queries) | |||
Work books | Excel Worksheet Functions |