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: 23
Default Type Mismatch

Hello. I am having a little problem with this code. Under ideal conditions
it does seem to work just fine. I've found that it seems to bug out when it
reaches a Cell (which the value is to be put in the "Entry" Object) that
happens to be blank. Now as far as I know that shouldn't cause a problem.
The really strange thing is that is gives a "Type Mismatch" error. I figured
It might have a space in there which when I click on the cell and use the
arrow keys to move the cursor through any spaces it doesn't move. I press
delete over the cells and it gets past that one line. So something is in
there but nothing I can find. Is there a way I can get it to pass over these
Not so blank Cells. Or maybe its just a problem with my code. Thank you for
your time. (part of the code is below incase you want a look through it.
The problem areas seem to be in the If statements with the < "" in them)

Mark



RowNum = 1
Do While (Worksheets("GL Hazard Schedule").Range("B" & RowNum).Value < "")
Or _
(Worksheets("GL Hazard Schedule").Range("B" & RowNum + 1).Value <
"")
RowNum = RowNum + 1
Loop
RowNum = RowNum - 1

Set MyRange = Worksheets("GL Hazard Schedule").Range("A3:AI" & RowNum)
RowNum = RowNum - 2

For i = 1 To RowNum
Quotes = 0
MsgBox "fsdfs"
Set Entry = MyCol(MyRange.Range("B" & i))
Do While MyRange.Range("B" & i).Value < ""
Entry.Zip = MyRange.Range("F" & i).Value
If MyRange.Range("U" & i).Value < "" Then
Entry.GlLoc = MyRange.Range("Y" & i).Value
Entry.GlHaz = Quotes
If MyRange.Range("AB" & i).Value < "" Then
Entry.ClassCode = MyRange.Range("AB" & i).Value
End If
If MyRange.Range("AH" & i).Value < "" Then
Entry.GlPremium = MyRange.Range("AH" & i).Value
End If
If MyRange.Range("AI" & i).Value < "" Then
Entry.GlPremium = MyRange.Range("AI" & i).Value
End If
End If
Quotes = Quotes + 1
i = i + Quotes
Loop
'MyCol.Add Item:=Entry, Key:=Entry.QuoteID
Next i
 
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
Type Mismatch?? Otto Moehrbach Excel Programming 4 December 28th 05 03:03 PM
Type mismatch using rnge as Range with Type 8 Input Box STEVE BELL Excel Programming 11 December 3rd 05 05:02 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
Type Mismatch now, not before davegb Excel Programming 2 September 2nd 05 11:37 PM
Type mismatch Patti[_5_] Excel Programming 3 May 30th 04 02:44 PM


All times are GMT +1. The time now is 04:34 AM.

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

About Us

"It's about Microsoft Excel"