|
-
Jul 19th, 1999, 08:29 PM
#1
Thread Starter
New Member
Hey guys, I am having trouble with this function:
_________________
Function DelState(c As Object)
Dim x1, y1 As Integer
x1 = 1
y1 = 10
Do
If c.Text <> "CT" Or "DC" Or "IN" Or "MA" Or "MD" Or "ME" Or "MI" Or "NH" Or "NJ" Or "OH" Or "PA" Or "RI" Or "VT" Or "WI" Or "WVA" Then
Call DeleteRow(x1, y1)
End If
x1 = x1 + 1
Loop Until x1 = maxrows + 1
End Function
__________________
I have an excel worksheet as an object and I am trying to test for the text not the values in a cell. But c.text gives me a type error.
What shall i do.
P.S. The rest of the prog works fine...
-
Jul 20th, 1999, 02:09 AM
#2
Maybe the cells are formatted as numbers not text, that would explain why you would get a
type mismatch error. But this is just a wild guess.
-
Jul 20th, 1999, 08:18 PM
#3
Lively Member
The problem is in your compare statement... you need to try it this way...
if c.Text <> "CT" and c.Text<> "DC" and c.Text <> "IN" ... etc...
You are getting a type mismatch because you are doing a logical statment (c.Text <> "CT") and then you are doing a logical OR with a string.
Bash
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|