PDA

View Full Version : Solved: Two versions of one project -- oops!



GreenTree
05-15-2007, 09:44 PM
I've been working on a large project for quite some time, careful to save with a new file name after each major bit of work. MyProject001.xls, MyProject002.xls, etc.

Well, I goofed. Don't ask me how, it's too foolish to go into. But from MyProject035.xls, there are now two successor files, each of which has some (different) new additions, call them MyProject036CoolCode.xls, and MyProject036NewStuff.xls. Yeah, really, really clever, I know. :whyme:

Is there a way to compare the two 036 versions and find out where code that isn't the same in them resides? Most of the changes are in big blocks in separate places, and it won't be hard to put them back together into a 037 version that has the new stuff from both of the 036's, but I'd really like to make sure I don't miss tiny little changes that I made somewhere else.

Anybody know of a tool or method to see where the code in the two spreadsheet files differs? (The data in the worksheets is significantly different, but that's not a concern, just where the differences are in the code.)

Many thanks,

G.T. :oops:

johnske
05-15-2007, 10:08 PM
Not that I know of - but a simple way is to copy the code from the procedure (or code module) in one workbook. Select A1 on a worksheet and paste.

Now copy the code from the same procedure (or code module) in the other workbook and select (say) I1 on the same worksheet and paste.

Now insert this formula
=(A1=I1) in the first row of another column and fill down - you then get TRUE if each line's the same, and FALSE if they're not. :)

EDIT: I could do a VBA procedure to do this for you but it seems unnecessary just for a "one-off" thing.

Jan Karel Pieterse
05-15-2007, 10:51 PM
The VBE also has the capability of tiling code windows, so I would:

- open the two files
- close all their code windows
- open two same modules
- close project explorer and props window
- window, tile vertically

xld
05-16-2007, 01:29 AM
You could also export the code modules, this dumps them into text files, and use one of the many free text editors out there that does file comparisons.

GreenTree
05-17-2007, 06:14 PM
Good inputs, many thanks!

Solved.