LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "ByRef argument type mismatch" Error


"ByRef argument type mismatch" Error for WeekNum(Comp_Date)
Help please...

Sub TAT()
Dim Effect_Recd_Date, Effect_Recd_Time As Date
Dim Recd_Date, Recd_Time, Comp_Date, Comp_Time, Shift_Start, Shift_End
As Date
Dim Week_End As Date
R = 6
C = 35
Shift_Start = Range("D2").Value
Shift_End = Range("H2").Value
Week_End = DateSerial(2005, 1, 10) + (2 * Shift_Start)
DateSerial(2005, 1, 7) - Shift_End
Do
Recd_Date = Cells(R, C).Value
Recd_Time = Cells(R, C + 1).Value
'Calculation of Effective Received Time
If ((Recd_Time < Shift_End) Or ((Recd_Time = Shift_Start) An
(Recd_Time < 1))) Then
Effect_Recd_Time = Recd_Time
Else: Effect_Recd_Time = Shift_Start
End If
'Calculation of Effective Received Date
If ((Recd_Time < Effect_Recd_Time) And (Weekday(Recd_Date
vbMonday) 5)) Then
Effect_Recd_Date = Recd_Date + 8 - Weekday(Recd_Date
vbMonday)
Else: Effect_Recd_Date = Recd_Date
End If
Cells(R, C + 2).Value = Effect_Recd_Date
Cells(R, C + 3).Value = Effect_Recd_Time
'TAT Hour Calculation
Comp_Date = Cells(R, C - 11).Value
Comp_Time = Cells(R, C - 10).Value
If (WeekNum(Comp_Date) < WeekNum(Effect_Recd_Date)) Then
TAT_Hour = Comp_Date + Comp_Time - Recd_Date - Recd_Time
End If

R = R + 1
Loop

'INT((X6+Y6-AA6-AB6)*24)-IF(WEEKNUM(X6)<WEEKNUM(AA6),(WEEKNUM(X6)-WEEKNUM(AA6))*54.5,0)

End Sub

Function WeekNum(WeekDate As Date)
WeekNum = Round((DateSerial(Year(WeekDate), Month(WeekDate)
Day(WeekDate)) _
- DateSerial(Year(WeekDate), 1, 0)) / 7, 0)
End Functio

--
Baap
-----------------------------------------------------------------------
Baapi's Profile: http://www.excelforum.com/member.php...fo&userid=2733
View this thread: http://www.excelforum.com/showthread.php?threadid=46837

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ByRef argument type mismatch error? sermest Excel Programming 4 June 17th 05 06:50 PM
Run-time Error "13" - File Type Mismatch brentm Excel Programming 1 February 10th 05 05:09 PM
Help with Run-time error: "Type Mismatch" Metin Excel Programming 2 January 26th 05 02:11 PM
"FIND" generates "Type mismatch" error quartz[_2_] Excel Programming 5 November 16th 04 03:29 PM
Copying data to another worksheet gives "Type Mismatch" error TB[_3_] Excel Programming 6 July 28th 03 12:44 PM


All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"