View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
beginner here beginner here is offline
external usenet poster
 
Posts: 25
Default Learning VBA-don't understand error message

Im starting to studying a new macro book that I just got, and in the current
section that Im in, there is section that is called €śUsing user types with
arrays€ť. They have a sample code that I typed in a new spreadsheet, but when
I run the macro, I get this error

€ścannot define a Public user-defined type within an object module€ť

My code that is causing the error is this, and I have checked several times
that I have typed the code in correctly.

€śType salesResults
spring As Single
summer AS Single
fall As Single
winter As Single
End Type€ť

I have search the VBA help, to find out to try and correct this error, but
havent found anything that is close to answering it for me.

Can explain to me what I have done wrong.

Cal