parscon
02-16-2012, 12:44 PM
I have this VBA Code but when run this code
Sub Test()
Dim v As Variant
For Each cell In Range("D1:D5")
cell.Value = "MS-" & Right$(cell.Value, Len(cell.Value) - 3)
Next cell
v = Application.Transpose(Range("D1:D2000").Value)
With Range("C1")
.Value = Join(v, "-")
Do While InStr(.Value, "--") > 0
.Value = Replace(.Value, "--", "-")
Loop
End With
End Sub
in line
cell.Value = "MS-" & Right$(cell.Value, Len(cell.Value) - 3)
I have error , please help me to fix this VBA .
THank you so much .
Sub Test()
Dim v As Variant
For Each cell In Range("D1:D5")
cell.Value = "MS-" & Right$(cell.Value, Len(cell.Value) - 3)
Next cell
v = Application.Transpose(Range("D1:D2000").Value)
With Range("C1")
.Value = Join(v, "-")
Do While InStr(.Value, "--") > 0
.Value = Replace(.Value, "--", "-")
Loop
End With
End Sub
in line
cell.Value = "MS-" & Right$(cell.Value, Len(cell.Value) - 3)
I have error , please help me to fix this VBA .
THank you so much .