View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
LWhite LWhite is offline
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