A module is pretty much like any other object. You can change its
properties, including Name, in the Properties window.
In the VBE: View>Properties (F4). Under the properties for the Module, you
can change the Name of Class1 to whatever your heart desires (as long as
it's comprised of legal characters, etc.).
BTW, the same is also true for General code modules. modAppVariables,
modGeneralFunctions, modFormHandling, modStringHandling, modArrayHandling...
HTH,
"David Gerstman" <(E-Mail Removed)> wrote in message
news:66C2867E-C0A8-4BB0-8DD7-(E-Mail Removed)...
> Is there anyway to rename to the class module? Or am I stuck with Class1,
> Class2 etc.
>
> I have seen code samples with the Class ... End Class structure. But not
> frequently.
>
> Thanks very much,
>
> David
>
> "George Nicholson" wrote:
>
>> I have used classes in Excel a lot, and I can only tell you what's worked
>> for me (up to & including XL & Access 2003):
>>
>> - Insert a Class Module.
>> - The name of that module is the name of your class.
>> - Add Variable declarations, Properties & Methods as desired.
>> - No Class...End Class structure is necessary. In fact (fwiw), my
>> language
>> references don't even show the existence of a "End Class" statement. They
>> show 'End Enum', 'End Type', 'End Property', etc., etc., but no 'End
>> Class'.
>>
>>
>> HTH,
>>
>>
>> "David Gerstman" <(E-Mail Removed)> wrote in message
>> news:BB8C3D91-636E-4CAE-BB47-(E-Mail Removed)...
>> > I'm trying to set up a class in the VBE.
>> >
>> > It doesn't make a difference if I try to include it in the regular or
>> > in a
>> > class module,
>> >
>> > when I write the following (for example)
>> > Class budget
>> > Public food As Currency
>> > Public car As Currency
>> > Public fun As Currency
>> >
>> > end class
>> >
>> > And hit return the "end class" gets flagged and I get
>> > "Compile error:
>> > Expected: If or Select or Sub or Function or Property or Type or With
>> > or
>> > Enum of end of Statement."
>> >
>> > What am I doing wrong? (I've also cut and pasted code for a class from
>> > MSDN
>> > and gotten the same error.)
>> >
>> > Or is there something wrong with my installation of VBA?
>> >
>> > David
>>
>>
>>
|