Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Programming
Class Module Method
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Matthew Pfluger, post: 11945985"] I have a class module called CInertiaData that contains 6 double variable declarations: Public dmMass As Double Public dmDensity As Double Public dmVolume As Double Public dmCOG_x As Double Public dmCOG_y As Double Public dmCOG_z As Double I declare new instances of this module as follows: Dim muInertiaData As CInertiaData Set muInertiaData = New CInertiaData At several points in my code, I want to reset all values in muInertiaData to 0. I'd like to write a method instead of a subroutine, but I'm not sure how to proceed. I believe it would be something like: Public Sub Clear(ByRef oInertiaData As CInertiaData) On Error Resume Next With oInertiaData .dmMass = 0 .dmDensity = 0 .dmVolume = 0 .dmCOG_x = 0 .dmCOG_y = 0 .dmCOG_z = 0 End With End Sub However, this still requires passing a CInertiaData object to the method. How do I write the method so it clears the CInertiaData object that calls it? I would guess that this involves changing the way I define my Class Module variables. Thanks, Matthew Pfluger [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Programming
Class Module Method
Top