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: 9
Default ByRef argument type mismatch error?

Hi I have below functions. I did not get what is mismatching. Can
anybody help? Thanks,



Function TYLY() As Integer
Dim FFW, LHW, FDate As Date
Dim FWRow, HWRow, HWColumn, FP, HP As Integer
Dim DateRange, FWCell, HWCell As Range
FFW = Worksheets("F").Cells(22, 49).Value
FP = Worksheets("F").Cells(23, 49).Value
LHW = Worksheets("F").Cells(25, 49).Value
HP = Worksheets("F").Cells(26, 49).Value
Set DateRange = Worksheets("F").Range("F:F")
Set FWCell = DateRange.Find(DateValue(FFW), ,
LookIn:=xlFormulas)
Set HWCell = DateRange.Find(DateValue(LHW), ,
LookIn:=xlFormulas)
FWRow = FWCell.Row
HWRow = HWCell.Row
HWColumn = HWCell.Column
......
With Cells(y, 38)
.Font.ColorIndex = 52
.Value = TValue(HWRow, HP, 7, FWRow)
.Interior.ColorIndex = 6
.......


The TValue function that I call above is below:

Function TValue(THWRow, THP, TDColumn, TFWRow As Integer) As Long
Dim TTY, TLY As Double
TValue = 0
TTY = 0
TLY = 0
For x = THWRow - THP + 1 To THWRow
TTY = TTY + Cells(x, TDColumn).Value
Next x
For y = THWRow - THP + 1 - 52 To THWRow - 52
TLY = TLY + Cells(x, TDColumn).Value
Next y
TValue = (TTY / TLY) * Cells(TFWRow, TDColumn)

End Function

 
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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Type Mismatch Error David Excel Discussion (Misc queries) 2 December 11th 05 04:46 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Type Mismatch Error SRS Man[_2_] Excel Programming 3 April 16th 04 03:49 PM
Type Mismatch Error Need Help Ray Batig Excel Programming 1 September 16th 03 12:57 AM


All times are GMT +1. The time now is 09:52 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"