Macro does not work when sent to another computer

  • Thread starter Thread starter walrus417
  • Start date Start date
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?
 
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
 
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.
 
Back
Top