This is what I got so far.
Option Explicit
Type ProgramData
pContract As Long
'pDocumentNumber As Long
'pID As Long
'pName As String
'pCOBJ As Integer
'pCalDRS As Single
'pDRSMatch As Single
'pNHICcert As Single
'pMACMatch As Single
End Type
Sub WriteShit(iTitle As Integer, iDetail As Integer, iRow As Integer, icontract As Integer, irowcontract As Integer)
Dim ETVArr() As ProgramData
Dim i As Single
Dim j As Integer
Dim LengthRowDetail As Integer
Dim LengthDetail As Integer
Dim LengthTitle As Integer
Dim ncol As Integer
Dim nrow As Integer
LengthTitle = iTitle
LengthDetail = iDetail
LengthRowDetail = iRow
ncol = icontract
nrow = irowcontract
i = 0
ReDim ETVArr(LengthRowDetail) As ProgramData
For i = 1 To LengthRowDetail
ETVArr(i).pContract = Cells(nrow + 2, ncol)
nrow = nrow + 1
Next i
Debug.Print ETVArr(0).pContract
It errors on ReDim ETVArr(LengthRowDetail) -> Subscript out of range;
Also, ETVArr(i).pContract stays literally ETVArr(i).pContract on Tooltip, What the heck is going on??
I am trying to loop values from a Excel into this UDT.
What is going on?
Any insight would be great! Please respond.
Thanks!
Option Explicit
Type ProgramData
pContract As Long
'pDocumentNumber As Long
'pID As Long
'pName As String
'pCOBJ As Integer
'pCalDRS As Single
'pDRSMatch As Single
'pNHICcert As Single
'pMACMatch As Single
End Type
Sub WriteShit(iTitle As Integer, iDetail As Integer, iRow As Integer, icontract As Integer, irowcontract As Integer)
Dim ETVArr() As ProgramData
Dim i As Single
Dim j As Integer
Dim LengthRowDetail As Integer
Dim LengthDetail As Integer
Dim LengthTitle As Integer
Dim ncol As Integer
Dim nrow As Integer
LengthTitle = iTitle
LengthDetail = iDetail
LengthRowDetail = iRow
ncol = icontract
nrow = irowcontract
i = 0
ReDim ETVArr(LengthRowDetail) As ProgramData
For i = 1 To LengthRowDetail
ETVArr(i).pContract = Cells(nrow + 2, ncol)
nrow = nrow + 1
Next i
Debug.Print ETVArr(0).pContract
It errors on ReDim ETVArr(LengthRowDetail) -> Subscript out of range;
Also, ETVArr(i).pContract stays literally ETVArr(i).pContract on Tooltip, What the heck is going on??
I am trying to loop values from a Excel into this UDT.
What is going on?
Any insight would be great! Please respond.
Thanks!