kevvukeka
04-26-2013, 07:36 AM
Hi All,
I am working in excel in 2010. I need help with the below code.
Out of given range I need to replace few alphabets with blanks. I dont know VBA but i searched and could gather few codes in to 1. But it shows a compile error for text1() variable. Can any help.
Below is my code.
Sub findreplace()
Dim i As String
Dim Default
Dim raypoints() As String
Dim text1() As
String, text2 As String
Default = "A,B,C,D,E,F,G,H"
i = InputBox("Letters to Remove", Default, Default)
text2 = ""
raypoints = Split(i, ",")
For text1 = 0 To UBound(raypoints)
With ActiveSheet.Selection
.Cells.Replace what:=text1, Replacement:=text2, LookAt:=xlPart,
_
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False
End With
Next
text1
End Sub
Thanks & Regards,
Praveen
I am working in excel in 2010. I need help with the below code.
Out of given range I need to replace few alphabets with blanks. I dont know VBA but i searched and could gather few codes in to 1. But it shows a compile error for text1() variable. Can any help.
Below is my code.
Sub findreplace()
Dim i As String
Dim Default
Dim raypoints() As String
Dim text1() As
String, text2 As String
Default = "A,B,C,D,E,F,G,H"
i = InputBox("Letters to Remove", Default, Default)
text2 = ""
raypoints = Split(i, ",")
For text1 = 0 To UBound(raypoints)
With ActiveSheet.Selection
.Cells.Replace what:=text1, Replacement:=text2, LookAt:=xlPart,
_
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False
End With
Next
text1
End Sub
Thanks & Regards,
Praveen