Array not recognized

sculler

New Member
Joined
May 27, 2013
Messages
3
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


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
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top