Type Mismatch error

W

WLMPilot

Below is part of the code I am using. I get a "Type Mismatch" error on the
line I indicate as "<----ERROR" Why?

Basically, this routine takes the dates for paid holidays (holdate) and
compares it to the date (on active row) + 7 days. If holdate < wdate+7, then
the current cell value(cv) is pulled in. I then add the holiday hours
(holhr) to cv and reinsert it back in the spreadsheet.

DIM cv, holhr(11) as Variant "I guess this is correct Dim for ##.## format

For Each Cell In rngpc
wdate = Cell.Offset(0, -13).Value 'Get Beg of week date
For cntr = 1 To cnt - 1
cv = Cell.Value 'Get value of cell
MsgBox holdate(cntr) & " < " & wdate + 7 & " CV= " & cv
If holdate(cntr) < wdate + 7 Then
Cell.Value = cv + holhr(cntr) <======ERROR
End If
Next cntr
Next Cell

Thanks for your help!

Les
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top