Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile error: type mismatch
Excel 2000
I am getting a Compile error: Type Mismatch, "G26" is highlighted. How do I clear this problem? 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 --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile error: type mismatch
Looks as though CheckRange wants a range, not a string.
Try: sMsg = sMsg & CheckRange(Range("G26")) Rob "pjhageman " wrote in message ... Excel 2000 I am getting a Compile error: Type Mismatch, "G26" is highlighted. How do I clear this problem? 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 --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile error: type mismatch
Thanks, Rob, this cleared the problem.
Rob van Gelder wrote: *Looks as though CheckRange wants a range, not a string. Try: sMsg = sMsg & CheckRange(Range("G26")) Rob "pjhageman " wrote in message ... Excel 2000 I am getting a Compile error: Type Mismatch, "G26" is highlighted. How do I clear this problem? 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 --- Message posted from http://www.ExcelForum.com/ * --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Type Mismatch Error | Excel Discussion (Misc queries) | |||
Type Mismatch Error - Help Please | Excel Worksheet Functions | |||
Type Mismatch Error | Excel Discussion (Misc queries) | |||
Type Mismatch Error Need Help | Excel Programming |