| Function RemoveText(pText, pStart, pEnd) ' don't change the passed values lEnd = pEnd lStart = pStart sText = pText If lEnd > lStart Then RemoveText = sText Exit Function End If If lStart < 1 Then lStart = 1 End If If lEnd > Len(sText) Then lEnd = Len(sText) End If For i = 1 To Len(sText) If i >= lStart And i <= lEnd Then 'skip it Else sNew = sNew & Mid(sText, i, 1) End If Next RemoveText = sNew End Function |