Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Amend a macro by macro

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.





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Amend a macro by macro

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.







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Amend a macro by macro


There's some search/replace code for VBA on my website. With a few tweaks it
could be useful to your situation.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"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.







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Amend a macro by macro

On the same idea, I want to find and replace a text string "zzz" wit
"yyy" in macro1. Can I write another macro to do this?

Thanks
Matthe

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Amend a macro by macro

Should work.

But why not just do it manually in the VBE under Edit=Replace

--
Regards,
Tom Ogilvy

"Matthew McManus " wrote in
message ...
On the same idea, I want to find and replace a text string "zzz" with
"yyy" in macro1. Can I write another macro to do this?

Thanks
Matthew


---
Message posted from http://www.ExcelForum.com/





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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 06:02 AM.

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"