Hello Beautiful People
I am trying to use an array that relates a row from a scheduling page I have to a database row in another worksheet. The array "RD_to_ProjSum_Array(RD_Row) takes RD_ROW (my database row) and returns the schedule row
excel keeps saying that "Sub or Function is not defined" and highlights my RD-to_ProjSum_Array(RD_Row)
When I access the array from where it was created; the worksheet code page, it works fine.
However, when I access it from my function bank (in separate module) it is no longer defined.
Here is the code where I construct the array
Here is the code where I access the array:
Any tips or help would be great, I am still learning vba
I am trying to use an array that relates a row from a scheduling page I have to a database row in another worksheet. The array "RD_to_ProjSum_Array(RD_Row) takes RD_ROW (my database row) and returns the schedule row
excel keeps saying that "Sub or Function is not defined" and highlights my RD-to_ProjSum_Array(RD_Row)
When I access the array from where it was created; the worksheet code page, it works fine.
However, when I access it from my function bank (in separate module) it is no longer defined.
Here is the code where I construct the array
Code:
ReDim RD_to_ProjSum_Array(RD_Row To RD_Row + Worksheets("Raw Data").Range("A7").End(xlDown).Row)
'Loop where Current Row and RD Row will increment differently based on the contents of the spreadsheet
RD_to_ProjSum_Array(RD_Row) = CurrentRow
Here is the code where I access the array:
Code:
For i = 1 To (LastRow - 6) * 250
'Code checks if there is a blank cell in front of a highlighted one, then saves information from another row as start date
If .Cells(i).Offset(0, -1).Interior.ColorIndex = xlNone And .Cells(i).Interior.ColorIndex <> xlNone Then
StartDate = Cells(4, .Cells(i).Column)
For RD_Row = 8 To 8 + Worksheets("RawData").Range("A7").End(xlDown).Row
'this array gives the corresponding row number on another data sheet (enter the database row, get the schedulepage row
If RD_to_ProjSum_Array(RD_Row) = i Then
Worksheet("Raw Data").Cells(RD_Row, StartDate_Column) = StartDate
End If
Next RD_Row
End If
Next i
Any tips or help would be great, I am still learning vba