Hi,
I am trying to pass an array generated on one button click to a subroutine button click. For example
Private Sub Retrieve_Attendance_click(ByRef LArrayDatesOfPay() As String)Dim todays_date_from As Variant Dim todays_date_to As Variant Dim rowNumSubmit As Range 'Dim LArrayDatesOfPay() As String Dim txtB1 As Control Dim myrow_10() As Integer 'Main.Hide 'Submit_Wages.Retrieve_Attendance.Visible = False Call PopulateArrayEmployed todays_date_from = Me.Date_Picker_Wages_Start_Date.Value todays_date_to = Me.Date_Picker_Wages_End_Date.Value x = 1 For Each rowNumSubmit In ThisWorkbook.Worksheets("Input Take Sheet").Range("Input_take_table[Date]").Rows ReDim Preserve myrow_10(x) myrow_10(x) = rowNumSubmit.row - 1 If ThisWorkbook.Worksheets("Input Take Sheet").Range("Input_take_table[Date]").Rows(myrow_10(x)).Value >= todays_date_from _ And ThisWorkbook.Worksheets("Input Take Sheet").Range("Input_take_table[Date]").Rows(myrow_10(x)).Value <= todays_date_to Then ReDim Preserve LArrayDatesOfPay(x) LArrayDatesOfPay(x) = ThisWorkbook.Worksheets("Input Take Sheet").Range("Input_take_table[Date]").Rows(myrow_10(x)).Value x = x + 1 End If Next
and then
Private Sub Wages_Submit_Click()Dim LArrayDatesOfPay() As Date Call Retrieve_Attendance_click(LArrayDatesOfPay) MsgBox UBound(LArrayDatesOfPay) End Sub
But it keeps coming up with a compile error Procedure declaration does not match description of event or procedure having the same name error.
Any help would be greatly appreciated.
Kind Regards