Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I am receiving a "ByRef argument type mismatch" error with the piece highlight in red in the code below. The Variable st was declared in the module that called the inf_prep routine.
Rich (BB code):
Sub inf_prep (srow As Integer, pnum As String, fac2 As String, nrec As Long, st As Variant, pt As String, bkg_date As Date, prep_type As String, prep_date As Date, prep_time As String, posnum As Long, posx As Long)
Dim d_cell As Range 'destination cell on ws_master to send crew
Dim bkg_date As Long
Set d_cell = ws_master.Cells(srow, 9)
bkg_date = CLng(ws_master.Range("M1").Value)
If pt = "D" Or pt = "F" Or pt = "C" Then
stop
Else
prep_active st, fac2, bkg_date
End If
' . . . . . more code >
End Sub
Rich (BB code):
Sub prep_active(srow As Integer, st As Variant, pnum As String, fac2 As String, bkg_date As Long, prep_type As String, prep_date As Date, preptime As String, posnum As Long, posx As Long)
Dim srow As Integer
Dim st As Variant
Dim pnum As String
Dim fac2 As String
Dim cnt_b_label As Long, posnum As Long, posx As Long
Dim prep_type As String
Dim prep_date As Date
Dim prep_time As String
Dim d_th As Long
Dim sr As Range
' . . . . < more code > . . . .
prep_type = "CHK" 'checkup
prep_date = Format(bkg_date, "dd-mmm")
prep_time = "<" & Format(st - TimeSerial(0, 30, 0), "h:MM A/P")
' . . . . < more code > . . . .
End Sub
Last edited: