Excel VBA Macro: Remove Special Characters (in List of Strings) & Post New Strings Next to Old Ones

  Рет қаралды 804

greggowaffles

greggowaffles

Жыл бұрын

Excel VBA Macro: Remove Special Characters (in List of Strings) & Post New Strings Next to Old Ones
💥Subscribe: / @greggowaffles
Code:
Sub remove_spec_chars_in_list()
Dim ws As Worksheet
Dim spec_chars As Variant
Dim x As Variant
Dim row_count As Integer
Dim i As Integer
Dim cur_str As String
Set ws = ThisWorkbook.Sheets("Sheet1")
spec_chars = Array("<", ">", "\", "/", "?", "*", ":", """", "|")
ws.Activate
row_count = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlDown)))
For i = 2 To row_count
cur_str = ws.Cells(i, 1).Text
For Each x In spec_chars
cur_str = Replace(cur_str, x, "")
Next x
ws.Cells(i, 2) = cur_str
Next i
End Sub
#excelvba #excelmacro

Пікірлер: 5
@IndustrialGuy
@IndustrialGuy Жыл бұрын
Your tutorials are helping me immensely as I sort out my companies processes and make data entry much easier. Thanks for your clear and concise work dude!!
@greggowaffles
@greggowaffles Жыл бұрын
Really appreciate the feedback!! Would be open to any video topic suggestions as you come across them at your company. Thanks!!
@kameya1104
@kameya1104 Жыл бұрын
Learned something new today on looping an array... awesome... thanks
@greggowaffles
@greggowaffles Жыл бұрын
Glad to hear that. Thanks for watching!!
@vijayannamasivayam8806
@vijayannamasivayam8806 Жыл бұрын
I have too many "-_ in a string, i have to retain the first one then replace all with none
How to Use the VBA Replace Function in Excel
8:13
MyExcelOnline.com
Рет қаралды 1,8 М.
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 36 МЛН
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
Inside Out 2: Who is the strongest? Joy vs Envy vs Anger #shorts #animation
00:22
How to get the Last Row in VBA(The Right Way!)
15:41
Excel Macro Mastery
Рет қаралды 154 М.
How to Get List of File Names in a Folder using Excel
5:40
Excel Weez
Рет қаралды 6 М.
How to Remove Special Characters from Text Data in Excel
3:22
Chester Tugwell
Рет қаралды 105 М.
Excel VBA Macro: Delete Rows (Based on List of Values)
12:22
greggowaffles
Рет қаралды 606