patticlaire
New Member
- Joined
- Jun 15, 2018
- Messages
- 6
I have a publicly defined list of PMs (PM is a class). A PM object has a name, group, and pin. I have 6 worksheets that are named at "PM Name - Indicators" where the PM Name is the name of whatever object. The PMs have projects assigned to them (project is also a class object).
I am trying to update each of the six sheets with the PM's assigned projects. The bolded line is throwing a runtime error 91, but I can't figure out why
Public Sub updatePMSheets()
Dim aWorksheet As String
Dim startcell As Range
Dim i As Integer
Dim sheetName As String
For Each aPM In PMList
aWorksheet = aPM.GetName & " - Indicators"
startcell = Worksheets(aWorksheet).Range("B2")
For i = 1 To aPM.ProjectCount
startcell.Offset((i - 1), 0).Value = aPM.GetProject(i)
Next
Next
End Sub
I am trying to update each of the six sheets with the PM's assigned projects. The bolded line is throwing a runtime error 91, but I can't figure out why
Public Sub updatePMSheets()
Dim aWorksheet As String
Dim startcell As Range
Dim i As Integer
Dim sheetName As String
For Each aPM In PMList
aWorksheet = aPM.GetName & " - Indicators"
startcell = Worksheets(aWorksheet).Range("B2")
For i = 1 To aPM.ProjectCount
startcell.Offset((i - 1), 0).Value = aPM.GetProject(i)
Next
Next
End Sub