See Chip Pearson's site for manipulating code with code.
http://www.cpearson.com/excel/vbe.htm
If your code is protected with a password, you would have to unprotect it
manually or try using sendkeys.
Search this group in
http://groups.googles.com go to advanced search.
Search for password, VBE and possibly sendkeys.
--
Regards,
Tom Ogilvy
"Gareth" wrote in message
...
Our department sent out about 3,000 copies of a file about 3 months agoand
they are now starting to be returned to us so that data entered by users
can
be analysed.
It has come to our attention that there are a couple of small errors in
the
macros which will slow down the process of analysing the data. It is
possible to 'fix' the errors manually but it all takes time.
I wondered if there was any way to amend a macro in 'returnedfile.xls'
using
a macro in' fixitfile.xls'.
The two main problems are as follows:
In mod4 (Module) in 'returnedfile.xls' I want to enter
Worksheets("Sheet1").Unprotect "password" between line 401 and line 402
In frm3 (Form) in 'returnedfile.xls' I want to move lines 31 - 35 and put
them at the end of all the code (line 93) and then add End Sub
Don't know if this is even possible but looking forward to any
suggestions.
Thanks in advance.