it worked finally!
But just one thng how do I replace special characters.
Do I have to copy them from xl sheet and paste in my script below..
is there any automated way of removing any special characters?
Thanks
Private Sub Worksheet_Change(ByVal Target As Range)
For x = 0 To 9
Cells.Replace What:=x, Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Next x
Cells.Replace What:="&", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="/", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="#", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="-", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:=".", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
End Sub
But just one thng how do I replace special characters.
Do I have to copy them from xl sheet and paste in my script below..
is there any automated way of removing any special characters?
Thanks
Private Sub Worksheet_Change(ByVal Target As Range)
For x = 0 To 9
Cells.Replace What:=x, Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Next x
Cells.Replace What:="&", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="/", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="#", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="-", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:=".", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
End Sub