Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form to select 2 spreadsheets
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form to select 2 spreadsheets
Heather Heritage wrote: 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. Thanks for your reply. How do I "populate then with the names of the open workbooks", without typing them in? "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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do you get outlook to select from list on a form | Excel Discussion (Misc queries) | |||
How do I set up a form to select files from | Excel Programming | |||
Form Button - Select Row | Excel Programming | |||
How do I set up a form that narrows a data set w/ each menu select | Excel Programming | |||
Select all/Deselect all button in a form | Excel Programming |