The code as written would not run at all because :-
Code
-------------------
With ActiveSheet
-------------------
(has not been used correctly and) you have missed out "End With" whic
would stop compiling before the macro runs.
Delete this line and (instead of Sheet1.Range("O1").Value = "Martyn")
use :-
Code
-------------------
ActiveWorkbook.Worksheets("Sheet1").Range("O1").Va lue = "Martyn"
-------------------
--
Message posted from
http://www.ExcelForum.com