open / close files and display names

J

Jack

i have 6 i would like to open - but not go to each file as it opens - but add
the file name to the current sheet as the files open.

when i close the files i would like to do the opposite and remove the file
name from the current sheet ast the files close. When i close the files 2 of
the files i need to save and the other 4 just close.

thanks
jack
 
B

Bob Bridges

One design suggestion: Instead of putting the names of the opened workbooks
in your sheet, how about you have the names there already and just mark them
"open" or "closed" or whatever in a different column? This allows your
program to read the workbooks to open or close without having to have them
hard-coded in the program itself; you or another user could change the list
right there in the worksheet.

But however you do it, you haven't asked your question yet. You want to do
what you've described below, but obviously you've tried that and you're
having a problem; so what's the problem? What did you try, and how is it not
working?

Or is it that you know nothing about VBA programming and don't know how to
start? If it's that, at least say so and maybe someone will be willing to
give you some tutoring. (I probably would, for one, a little at a time.)
 
J

Jack

Bob

Thanks for your reply.

i have a macro that will open the files but i was trying to cut down on the
visual noise and that is when the list idea came up. I understand some of
the basics and what i have works but i'm trying to make it better.

i appreciate your help
jack
 
B

Bob Bridges

Well, I always approve of trying to make a program better. Ok, then, it
seems to me that you need to change the syntax of the assignment statement
when you're closing your sheets. Change the cells .Value assignment to
..Text, and change those single quotes to double quotes (remember you're in
VBA, not REXX). That should fix the immediate problem. But of course that
doesn't mean another problem won't pop up behind it as soon as you have the
obvious one fixed.

Or if that doesn't fit your circumstances, maybe instead of my trying to
guess what's wrong with your program, try this: Tell us which part of your
program isn't working, and what it IS doing instead. Like this: "I want to
remove the file name from worksheet 'FileList', but when I use the
Range.Remove action, I get the following error message...", or "...but I
don't know what command is equivalent to deleting the contents of a cell", or
whatever.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top