wibbers2000
12-13-2005, 06:30 AM
Hi,
I have a problem with my else if's. I have a sheet with just one populated column. This column is in text format and consists of 5 char then a "-" the 5 more char (01801-12564, or OBN03-15684 etc).
I would like to do a elseif within the first 3 to 5 char.
the code below works, but when I add an else if and only the first part works, all the others display "none". I am not sure what I need to do to get a match.
Sub changename()
Dim Count As Integer
Dim cell As Integer
Count = Range("a1").End(xlDown).Row
Range("a1").Offset(0, 2).Select
ActiveCell = Count
Range("a1").Offset(0, 1).Select
For cell = 1 To Range("c1").Value
ActiveCell.Offset(1, 0).Select
If ActiveCell.Offset(0, -1).Value Like "011*" Then
ActiveCell = "Briv"
Else
ActiveCell = "none"
End If
Next
End Sub
Can anyone point me in the right direction.
Regards
Wibbers
I have a problem with my else if's. I have a sheet with just one populated column. This column is in text format and consists of 5 char then a "-" the 5 more char (01801-12564, or OBN03-15684 etc).
I would like to do a elseif within the first 3 to 5 char.
the code below works, but when I add an else if and only the first part works, all the others display "none". I am not sure what I need to do to get a match.
Sub changename()
Dim Count As Integer
Dim cell As Integer
Count = Range("a1").End(xlDown).Row
Range("a1").Offset(0, 2).Select
ActiveCell = Count
Range("a1").Offset(0, 1).Select
For cell = 1 To Range("c1").Value
ActiveCell.Offset(1, 0).Select
If ActiveCell.Offset(0, -1).Value Like "011*" Then
ActiveCell = "Briv"
Else
ActiveCell = "none"
End If
Next
End Sub
Can anyone point me in the right direction.
Regards
Wibbers