title: Excel VBA: Should I Use a Class Module?
body: <p>Heylo, I am always looking to make my code cleaner, better, and more efficient. I am also always looking to make it easier to use and more maintainable. I have experience with Object-Oriented programming in C/C++, but I have been avoiding it with Excel VBA. I have been doing a lot of reading on Class Modules in VBA but I am unable to determine whether or not they are worthwhile for my situation.</p>
  
  <p>I have a custom Excel Add-In that has a normal Module. This module (generically named 'Module1') contains about 18 subroutines that all do completely different things. Each of these subroutines is connected to a custom button in a custom tab using the <code>ByVal control As IRibbonControl</code> argument in each subroutine, and some Ribbon XML to drive the layout and function.</p>
  
  <p>Anyways, as an example, I have written what I believe the Class Module and Normal Modules would look like in my case if I were to implement them:</p>
  
  <pre><code>' Class Module: TestClass
  Private sumVal As Double
  Private wsNames As String
  Public Sub Add(myRange as Range)
     For Each myCell In myRange
        sumVal = sumVal + myCell.Value
     Next myCell
     MsgBox "The sum of your range is: " &amp; sumVal
  End Sub
  
  Public Sub ChangeSettings()
     Application.Calculation = xlCalculationManual
     Application.ScreenUpdating = False
     Application.DisplayStatusBar = False
     MsgBox "The settings have been changed!"
  End Sub
  
  Public Sub PrintHello()
     MsgBox "Hellurrr!"
  End Sub
  
  Public Sub PrintSheetNames()
     Dim ws As Worksheet
     For Each ws In ActiveWorkbook.Sheets
        wsNames = wsNames + ws.Name + ", "
     Next ws
     MsgBox "The names of all sheets in this workbook are: " &amp; wsNames
  End Sub
  
  
  
  ' Normal Module: Module1
  Sub RunAdd(ByVal control As IRibbonControl)
     Dim ClsObj As New TestClass
     Dim theRange As Range
     Set theRange = Selection
     ClsObj.Add theRange
  End Sub
  
  Sub RunChangeSettings(ByVal control As IRibbonControl)
     Dim ClsObj As New TestClass
     ClsObj.ChangeSettings
  End Sub
  
  Sub RunPrintHello(ByVal control As IRibbonControl)
     Dim ClsObj As New TestClass
     ClsObj.PrintHello
  End Sub
  
  Sub RunPrintSheetNames(ByVal control As IRibbonControl)
     Dim ClsObj As New TestClass
     ClsObj.PrintSheetNames
  End Sub
  </code></pre>
  
  <p>Like this example, all of the subroutines I have are inherently different. My subroutines do not share variables or properties (so the iconic Car class is not applicable), nor does one subroutine execute several other subroutines.</p>
  
  <p>Would reformatting my current Normal Module into a new Class Module + Normal Module (as the driver) be beneficial to my situation at all?</p>
  
  <p>Thank you for any of your input in advance.</p>