
For Each v In Array(".", ":", "", "/", "?", "*", "+", Chr$(34), "<", ">", "|", "(", ")")
stringa = Replace(stringa, CStr(v), "")
Next |
Sub concatena()
Dim ur As Integer, rng As Range, stringa As String, cella As Range, v As Variant
With Sheets("anagrafica")
ur = .Cells(Rows.Count, 3).End(xlUp).Row
Set rng = Range(.Cells(2, 3), .Cells(ur, 3))
End With
For Each cella In rng
stringa = cella & cella.Offset(0, 1) & cella.Offset(0, 2)
For Each v In Array(" ", ",", ".", ":", "", "/", "?", "*", "+", Chr$(34), "<", ">", "|", "(", ")", Chr$(252), Chr$(220))
cella.Offset(0, 5) = Replace(stringa, CStr(v), "")
Next
Next
End Sub
|
Sub concatena()
Dim ur As Integer, rng As Range, stringa As String, cella As Range, v As Variant
Dim r As Integer, a
With Sheets("anagrafica")
ur = .Cells(Rows.Count, 3).End(xlUp).Row
Set rng = Range(.Cells(2, 3), .Cells(ur, 3))
End With
For Each cella In rng
stringa = cella & cella.Offset(0, 1) & cella.Offset(0, 2)
For Each v In Array(" ", ",", ".", ":", "", "/", "?", "*", "+", Chr$(34), "<", ">", "|", "(", ")", Chr$(252), Chr$(220))
stringa = Replace(stringa, CStr(v), "")
Next
cella.Offset(0, 5) = stringa
Next
End Sub
|
Option Explicit
Function strip(s As String) As String
Dim re As Object, matches As Object
Set re = CreateObject("vbscript.regexp")
With re
.MultiLine = False
.Global = True
.IgnoreCase = True
.Pattern = "[,;.:\/?*+<>|()x22xFCxDC]*"
End With
strip = re.Replace(s, "")
End Function |
