Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Type Mismatch error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WLMPilot - 23 Jan 2008 01:33 GMT
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
Dave Peterson - 23 Jan 2008 02:18 GMT
I'd check to see what CV held and what cntr held and what holhr(cntr) held.

> Below is part of the code I am using.  I get a "Type Mismatch" error on the
> line I indicate as "<----ERROR"   Why?
[quoted text clipped - 20 lines]
>
> Les

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.