When trying to use a class in VBA I keep getting a subscript out of range error and could use some help here!
This is the class –
Option Explicit
Private buildWs As String
Public Property Get affBuild() As String
affBuild = buildWs
End Property
Public Property Let affBuild(value As String)
buildWs = affBuild
End Property
Public Function activate()
Sheets(buildWs).activate
End Function
This is the call –
Sub SetWs()
Dim current As CBuildSheet
Set current = New CBuildSheet
current.affBuild = "Resource Entry"
current.activate
End Sub
this is wrong…
and should be…
see . http://ramblings.mcpher.com/Home/excelquirks/snippets/classes for getting started with classes.
Bruce