Sub or Function not defined

S

scottnshelly

Last week, i had a workbook that worked perfectly. I went on vacatio
and when i came back i get an error "Sub or Fuction not defined". th
only thing that it says is
Private Sub CommandButton3_Click()

Call changecolors

End Sub

what could possibly be wrong with this that was not wrong last week?

and yes, i do have a module with the name changecolor
 
E

Edwin Tam

A macro called "changecolors" cannot located.

You said a "module" called "changecolor" exists. But the macro looks for a "macro" (a subroutine) called "changecolor" to execute.

Regards,
Edwin Tam
http://www.vonixx.com
 
S

scottnshelly

I meant i have a macro named changecolors in a module.
this is in module2:
Private Sub changecolors()
this is in sheet1:
Private Sub CommandButton3_Click()

Call changecolors

End Sub

this worked the other day.
thanks
 
N

NickHK

Scott,
Your "changecolors" routine is private, so sheet1 cannot see it. Change it
to Public.

NickHK
 
Top