View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Heather Heritage Heather Heritage is offline
external usenet poster
 
Posts: 5
Default Form to select 2 spreadsheets

Have 2 list boxes on your form, populate them with the names of the open
workbooks
- this code snippet gives an idea of the necessary
For Each ws In Application.Workbooks
MsgBox ws.Name
Next


add the ws.name to the listbox, then use the selected text of the listbox to
determine which file to run it on.

"davegb" wrote in message
oups.com...
In Chip Pearson's macro to compare 2 spreadsheets, he uses a form in
which you enter the names of the 2 spreadsheets you wish to compare.
I'd like to use that same form for a macro I'm writing which compares
the rows in 2 spreadsheets and does some manipulations on them.

I looked at the code for Chip's macro, tried to copy what I thought
were the appropriate parts into my spreadsheet, and run it. It didn't
work. I'm not sure if I got the right code, his macro is so advanced to
me that I couldn't make sense of most of it.

I tried to modify Chip's form by removing the controls I didn't need,
then exporting it to another directory, change the name, the import it
back in, but that didn't work either.

What I'd like to do is have a form that allows the user to select 2
files from any open files, just like Chip's does, but then have my code
run on those files. Can anyone help me here, point me in more
productive directions?