Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you get outlook to select from list on a form gbpg Excel Discussion (Misc queries) 1 August 27th 07 05:54 PM
How do I set up a form to select files from greaseman[_5_] Excel Programming 3 April 10th 06 10:10 PM
Form Button - Select Row Paul Brown[_2_] Excel Programming 4 January 21st 06 01:44 PM
How do I set up a form that narrows a data set w/ each menu select Joeglobal Excel Programming 1 July 5th 05 11:03 PM
Select all/Deselect all button in a form Stuart[_5_] Excel Programming 2 August 6th 03 07:55 PM


All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"