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
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