Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Type Mismatch

Getting a Compile error: Type Mismatch. "G26" (including
the quotation marks) is highlighted. Can someone tell me
what is wrong with this code?

Public Function ValidScorecard() As Boolean
Dim sMsg As String
ValidScorecard = True
sMsg = sMsg & CheckRange("G26")
sMsg = sMsg & CheckRange("AG26")
sMsg = sMsg & CheckRange("G44")
sMsg = sMsg & CheckRange("AG44")
If Len(sMsg) 0 Then
MsgBox sMsg
ValidScorecard = False
End If
End Function
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Type Mismatch

Phil,

Not much chance if they don't know what CheckRange is. I suggested that you
post it to me, as it works here

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Phil Hageman" wrote in message
...
Getting a Compile error: Type Mismatch. "G26" (including
the quotation marks) is highlighted. Can someone tell me
what is wrong with this code?

Public Function ValidScorecard() As Boolean
Dim sMsg As String
ValidScorecard = True
sMsg = sMsg & CheckRange("G26")
sMsg = sMsg & CheckRange("AG26")
sMsg = sMsg & CheckRange("G44")
sMsg = sMsg & CheckRange("AG44")
If Len(sMsg) 0 Then
MsgBox sMsg
ValidScorecard = False
End If
End Function.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Type Mismatch

Phil,

What sort of argument is CheckRange expecting? If it is expecting
a range, you need to pass it a range reference. E.g.,

sMsg = sMsg & CheckRange(Range("G26"))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Phil Hageman" wrote in
message ...
Getting a Compile error: Type Mismatch. "G26" (including
the quotation marks) is highlighted. Can someone tell me
what is wrong with this code?

Public Function ValidScorecard() As Boolean
Dim sMsg As String
ValidScorecard = True
sMsg = sMsg & CheckRange("G26")
sMsg = sMsg & CheckRange("AG26")
sMsg = sMsg & CheckRange("G44")
sMsg = sMsg & CheckRange("AG44")
If Len(sMsg) 0 Then
MsgBox sMsg
ValidScorecard = False
End If
End Function



Reply
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 [email protected] Excel Worksheet Functions 1 May 16th 07 03:29 PM
Type Mismatch Error David Excel Discussion (Misc queries) 2 December 11th 05 04:46 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 07:59 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"