View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BCNU BCNU is offline
external usenet poster
 
Posts: 16
Default I have 15 floppies, I want to know the file names, worksheet n

thanx for the support. I copied/pasted in module 1 but get a compiler error
on with d.row(i). Is there a chance this should be rows?

You are using levels of Macro I've never used before so I have some
ignorance questions, if you have time.

is this macro set up to look at the workbook and worksheet name of another
file? I t
looks like it's using itself and creating a data page (which is fine). Am I
reading this right? How can I point it to the drive I want it to look at etc?

The rest I'll play with when I get past the compiler error.

Thanx again, I truly appreciate it.
"Tim Williams" wrote:

See this for finding all files

http://groups.google.com/groups?q=di... n.net&rnum=2

then try this to process each workbook

sub ProcessActiveWorkbook()

dim wb as workbook
dim i
dim s as worksheet
dim d as worksheet

set d=thisworkbook.worksheets("Data")
'sheet data has "filename" in A1, "sheetname" in B1

set wb =activeworkbook
i=d.cells(1,d.rows.count).end(xlup).offset(1,0).ro w

for each s in wb.worksheets
with d.row(i)
.cells(1).value=wb.name
.cells(2).value=s.name
end with
i=i+1
next s

end sub

(untested but should more or less work)

Tim


"bcnu" wrote in message
...
Looking to make a macro in one file that can open a floppy, find the
next
open row, record all the file names on that floppy (column A) next
row, then
record all the sheet names of that file in (columns B through
whatever is
needed). I would then put the next floppy in and the macro would
find the
next unused row and so on until I have read all floppies.

In short, I want to run the macro that will open the A drive, find
all file
names into variables, then find all sheet names in each file and
record the
results in another file that will keep expanding until all floppies
are read.

I do not know how many floppies there might be (eventually there
could be
600). The number of files/floppy will vary (but will usually be
about 4).
The numbers of sheets/file will vary (but will usually be about 3).