Type mismatch Excel 2004 - Variant

U

Umop

Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi, I have this code working fine on Windows Excel. AFAIK it should work fine with Mac Excel 2004. Currently it throws up and error saying type mismatch on line 11 .
Does anyone know what is going on?

1. Public Function NumPPLNumeric() As Integer
2. Dim Y As Variant
3. Dim intRow As Integer
4. Dim intCol As Integer
5.
6. intRow = 1
7. intCol = 1
8.
9. Y = Range("weight").Offset(intRow, -3).Value
10.
11. Do While (Y > 0 And Y " ")
12. NumPPLNumeric = NumPPLNumeric + 1
13. intRow = intRow + 1
14. Y = Range("weight").Offset(intRow, -3).Value
15. Loop
16.
17. End Function
 
B

Bob Greenblatt

Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi,
I have this code working fine on Windows Excel. AFAIK it should work fine with
Mac Excel 2004. Currently it throws up and error saying type mismatch on line
11 .
Does anyone know what is going on?

1. Public Function NumPPLNumeric() As Integer
2. Dim Y As Variant
3. Dim intRow As Integer
4. Dim intCol As Integer
5.
6. intRow = 1
7. intCol = 1
8.
9. Y = Range("weight").Offset(intRow, -3).Value
10.
11. Do While (Y > 0 And Y " ")
12. NumPPLNumeric = NumPPLNumeric + 1
13. intRow = intRow + 1
14. Y = Range("weight").Offset(intRow, -3).Value
15. Loop
16.
17. End Function
You need some kind of operator. You probably mean: (Y>0 and Y<>²²)
 
U

Umop

Cheers, There was in there, but didnt copy across properly.

Still not sure what is going on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top