Sub or Function not defined

  • Thread starter Thread starter scottnshelly
  • Start date Start date
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
 
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
 
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
 
Scott,
Your "changecolors" routine is private, so sheet1 cannot see it. Change it
to Public.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top