Вы можете заменить каждое значение в диапазоне ячеек, присутствующих в строке, на For Each
:
Function CleanDescription(rawDescription As String) As String
Dim punctuationRng As Range
Set punctuationRng = Worksheets("ToRemove").Range("A2:A33")
Dim cleanDesc As String
cleanDesc = rawDescription
For Each punctuationCell In punctuationRng
cleanDesc = Replace(cleanDesc, punctuationCell.Value, "")
Next punctuationCell
CleanDescription = cleanDesc
End Function
Если вам не нравится For Each Вы также можете достичь этого с For Loop
:
Dim cellValue As String
For r = 1 to punctuationRng.Rows.Count
For c = 1 to punctuationRng.Columns.Count
cellValue = punctuationRng.cells(r, c).Value
cleanDesc = Replace(cleanDesc, cellValue, "")
Next c
Next r