PDA

View Full Version : Solved: Run-time error '13'



siva
12-09-2007, 05:36 AM
Dear Friends,
When i run the following code for supervisor column, i get the following error message.
Run-time error '13"
Type mismatch.

When i debug, it's pointing to Case Is = "SOR" And "-9"

The code.
If Cells(1, ActiveCell.Column) <> "Job No." Then
MsgBox "invalid column! you must select column job no."
Else
Rowbase = ActiveCell.Row
columbase = ActiveCell.Column
For RowCount = 1 To Selection.Rows.Count
temp = Rowbase + RowCount - 1
If temp <> 1 Then
System = Mid(Cells(temp, columbase), 6, 3)
Process = Mid(Cells(temp, columbase), 10, 2)
value1 = Cells(temp, columbase)
Select Case System And Process
Case Is = 201 And 1
Cells(temp, columbase + 5) = "Cheng"
Case Is = 201 And 2
Cells(temp, columbase + 5) = "Cheng"
Case Is = "SOR" And "-9"
Cells(temp, columbase + 5) = "CHENG"
Case Else
Cells(temp, columbase + 5) = "Unknown"
End Select
End If
Next RowCount
End If

Bob Phillips
12-09-2007, 05:52 AM
Select Case True
Case System = 201 And Process = 1
Cells(temp, columbase + 5) = "Cheng"
Case System = 201 And Process = 2
Cells(temp, columbase + 5) = "Cheng"
Case System = "SOR" And Process = -"-9"
Cells(temp, columbase + 5) = "CHENG"
Case Else
Cells(temp, columbase + 5) = "Unknown"
End Select

siva
12-09-2007, 06:14 AM
Dear XLD,
Can i use wildcard to replace number
for example
Case System = "***" And Process = 1
Cells(temp, columbase + 5) = "Cheng"

Bob Phillips
12-09-2007, 06:26 AM
Case System Like "*" And Process = 1: MsgBox 1
Cells(temp, columbase + 5) = "Cheng"

siva
12-09-2007, 06:32 AM
Dear Xld,
Thank you very much..