B
beginner here
I’m starting to studying a new macro book that I just got, and in the current
section that I’m 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
haven’t found anything that is close to answering it for me.
Can explain to me what I have done wrong.
Cal
section that I’m 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
haven’t found anything that is close to answering it for me.
Can explain to me what I have done wrong.
Cal