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: 3
Default Mismatch!?

I've written this procedure below with some help and it
seems to work but I keep being informed of a type mismatch
on the line "If JData < 0..." Can anyone tell me why this
is happening? Also can anyone recommend a good code book
for referencing VBA on Excel 2000. I already have a text
book by Walkenbach but it doesn't have enough examples in
it.
Thanks, Bob

Private Sub CommandButton3_Click()
Dim JValue As Integer
Dim KValue As Integer
Dim LValue As Integer
Dim JData As Variant
Dim KData As Variant
Dim LData As Variant
Dim Data As Range
For i = 8 To 50
Set Data = Range("J" & i & ":O" & i)
JData = Range("J" & i)
KData = Range("K" & i)
LData = Range("L" & i)

If JData < 0 Then JValue = 0
If JData 0 Then JValue = 1


If KData < 0 Then KValue = 0
If KData 0 Then KValue = 1


If LData < 0 Then LValue = 0
If LData 0 Then LValue = 1


If JValue + KValue + LValue = 2 Then
Data.Font.ColorIndex = 5
End If

If JValue + KValue + LValue < 2 Then
Data.Font.ColorIndex = 10
End If
Next i
End Sub
 
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... George[_4_] Excel Discussion (Misc queries) 7 December 19th 07 12:20 PM
Type Mismatch Error - Help Please Launchnet Excel Worksheet Functions 5 July 20th 07 04:35 AM
Type Mismatch [email protected] Excel Worksheet Functions 1 May 16th 07 03:29 PM
run-time 13 Type mismatch simonsmith Excel Discussion (Misc queries) 2 May 18th 06 04:14 PM
type mismatch--how to fix rroach Excel Discussion (Misc queries) 2 July 14th 05 06:23 PM


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