D
diacci1st
Hi
The below code I am running works ok but I need to add an other part to it
as this one:
If Left(s, 1) = "1" Then
i = 183
iloc = InStr(i, s, " ", vbTextCompare)
t = 202
tloc = InStr(t, s, " ", vbTextCompare)
s1 = Left(s, i - 1)
s3 = Right(s, Len(s) - iloc)
s2 = "*************** "
Cell.Value = s1 & s2 & s3
But I am not too sure how to do it....
could you please help?
Sub AABB()
For Each Cell In Range("A1:A65000")
s = Cell.Value
If Left(s, 1) = "1" Then
i = 208
iloc = InStr(i, s, " ", vbTextCompare)
t = 223
tloc = InStr(t, s, " ", vbTextCompare)
s1 = Left(s, i - 1)
s3 = Right(s, Len(s) - iloc)
s2 = "*************** "
Cell.Value = s1 & s2 & s3
ElseIf Left(s, 1) = "2" Then
i = 61
iloc = InStr(i, s, " ", vbTextCompare)
t = 76
tloc = InStr(t, s, " ", vbTextCompare)
s1 = Left(s, i - 1)
s3 = Right(s, Len(s) - tloc)
s2 = "*************** "
Cell.Value = s1 & s2 & s3
Else
End If
Next
Cells.Select
Selection.Replace What:="""", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
The below code I am running works ok but I need to add an other part to it
as this one:
If Left(s, 1) = "1" Then
i = 183
iloc = InStr(i, s, " ", vbTextCompare)
t = 202
tloc = InStr(t, s, " ", vbTextCompare)
s1 = Left(s, i - 1)
s3 = Right(s, Len(s) - iloc)
s2 = "*************** "
Cell.Value = s1 & s2 & s3
But I am not too sure how to do it....
could you please help?
Sub AABB()
For Each Cell In Range("A1:A65000")
s = Cell.Value
If Left(s, 1) = "1" Then
i = 208
iloc = InStr(i, s, " ", vbTextCompare)
t = 223
tloc = InStr(t, s, " ", vbTextCompare)
s1 = Left(s, i - 1)
s3 = Right(s, Len(s) - iloc)
s2 = "*************** "
Cell.Value = s1 & s2 & s3
ElseIf Left(s, 1) = "2" Then
i = 61
iloc = InStr(i, s, " ", vbTextCompare)
t = 76
tloc = InStr(t, s, " ", vbTextCompare)
s1 = Left(s, i - 1)
s3 = Right(s, Len(s) - tloc)
s2 = "*************** "
Cell.Value = s1 & s2 & s3
Else
End If
Next
Cells.Select
Selection.Replace What:="""", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False