Macro does not work when sent to another computer

W

walrus417

I made a quick macro for my job and it works great on my computer but when I
send it to another machine, there is a complier error. Both Machines are
using 2007 and the file is saved as a .xlsm

I enabled macros on both machines and other macros I made on the worksheet
work. So there is just a problem with this one macro when it goes to another
macine. Here is the code:

ActiveCell.Select
ActiveCell.Formula = Time
ActiveCell.NumberFormat = "hh:mm AM/PM"
ActiveCell.Offset(1, 0).Select

That's is. Just a simple code

Any suggestions?
 
D

Don Guillett

Worked on my xl2007 but I may have done it this way.

Sub don()
With ActiveCell
.Value = Time
.NumberFormat = "hh:mm AM/PM"
.Offset(1).Select
End With
End Sub
 
J

Jim Rech

Fyi - When you report a macro error it's a good idea to indicate the
specific lline of code that produces the error. Second, include the text of
the error message. Text, not number like 1004.
 
Top