This is for an EXCEL Visual Basic Macro.
I need to change all column B data to only have alphanumeric characters on column C.
My code works only for one cell. I want to loop this code for every active cell. Can anybody help me on this?
Sub macroalphanum()
Dim a$, b$, c$, i As Integer
a$ = Range("C1").Value
For i = 1 To Len(a$)
b$ = Mid(a$, i, 1)
If b$ Like "[A-Z,a-z,0-9, ]" Then
c$ = c$ & b$
End If
Next i
Range("D1").Value = c$
End Sub