Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro stops running after file has moved

Hello,

I have a macro that goes through an entire workbook and
replaces every instance of NOW() with the current date -
1 year. I recorded the macro and received some help on
the proper syntax for replacing with the year old date.
After using the code I ran the macro and it worked. I
then created a button and copied the code into it and
that worked fine as well.

After making multiple copies and running the macro and
button repeatedly I copied the workbook onto my network
and asked someone else to test it. This failed so I
copied the file back to my hard drive and got it to
running again by running the replace manually. After the
manual run I started copying back new copies from the
network again and they ran fine. Another copy saved to
the network stopped working again.

Any ideas why this is happening?

Sheets("Vac&Sick").Select
Range("K1").Select
Cells.Replace What:="NOW()", Replacement:="date(" &
Year(Date) - 1 & ",12, 31)", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False
Application.CutCopyMode = False
Range("B2").Select
ActiveWorkbook.Save

LWhite
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Macro stops running after file has moved

This failed

Not much to go on. If the tester had Excel 2000 or earlier the
"SearchFormat:=False, _
ReplaceFormat:=False" part will fail since it's not supported. You can
safely delete it I think.

--
Jim Rech
Excel MVP
"LWhite" wrote in message
...
| Hello,
|
| I have a macro that goes through an entire workbook and
| replaces every instance of NOW() with the current date -
| 1 year. I recorded the macro and received some help on
| the proper syntax for replacing with the year old date.
| After using the code I ran the macro and it worked. I
| then created a button and copied the code into it and
| that worked fine as well.
|
| After making multiple copies and running the macro and
| button repeatedly I copied the workbook onto my network
| and asked someone else to test it. This failed so I
| copied the file back to my hard drive and got it to
| running again by running the replace manually. After the
| manual run I started copying back new copies from the
| network again and they ran fine. Another copy saved to
| the network stopped working again.
|
| Any ideas why this is happening?
|
| Sheets("Vac&Sick").Select
| Range("K1").Select
| Cells.Replace What:="NOW()", Replacement:="date(" &
| Year(Date) - 1 & ",12, 31)", LookAt:= _
| xlPart, SearchOrder:=xlByRows, MatchCase:=False,
| SearchFormat:=False, _
| ReplaceFormat:=False
| Application.CutCopyMode = False
| Range("B2").Select
| ActiveWorkbook.Save
|
| LWhite


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
Code Stops Running Instead of Debugging [email protected] Excel Discussion (Misc queries) 1 December 10th 08 07:15 PM
Instead of debugging, code just stops running [email protected] Excel Discussion (Misc queries) 1 August 13th 08 07:26 PM
Opening a file stops a Macro Bob Myers Excel Worksheet Functions 2 January 8th 08 11:50 PM
why excel stops running?? usiddiqi Excel Discussion (Misc queries) 2 May 17th 06 10:14 AM
I moved a file from work to home and now my color macro does not w nick s Excel Worksheet Functions 2 December 3rd 05 02:39 PM


All times are GMT +1. The time now is 10:08 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"