cpmurray1985
New Member
- Joined
- Mar 10, 2022
- Messages
- 15
- Office Version
- 365
- Platform
- Windows
Hello everyone,
I'm completely new to VBA and editing, so I need assistance with editing the code so that it removes specific words in a column from a list of words in another column. I found the following code from another post and it works, however, it will delete words that have the characters in them. An example:
(Existing words)
A1: Go in Isabelle
A2: Cats are indoors Arethe
A3: The fox forgot tomorrow is too late.
(Words I want removed)
C1: In
C2: The
C3: For
C4: To
C5: Is
C6: At
Results:
Go Abelle
C are doors Are
fox got morrow o late
How can I edit the code so it does exact matches and is not case sensitive (such as 'To' would also remove 'to', for example)? I would want to remove words such as "in" from the columns, but not from words like Coaching, Indoors, etc.
In case the link above does not work, I have posted the code below. Thank you.
I'm completely new to VBA and editing, so I need assistance with editing the code so that it removes specific words in a column from a list of words in another column. I found the following code from another post and it works, however, it will delete words that have the characters in them. An example:
(Existing words)
A1: Go in Isabelle
A2: Cats are indoors Arethe
A3: The fox forgot tomorrow is too late.
(Words I want removed)
C1: In
C2: The
C3: For
C4: To
C5: Is
C6: At
Results:
Go Abelle
C are doors Are
fox got morrow o late
How can I edit the code so it does exact matches and is not case sensitive (such as 'To' would also remove 'to', for example)? I would want to remove words such as "in" from the columns, but not from words like Coaching, Indoors, etc.
In case the link above does not work, I have posted the code below. Thank you.
VBA Code:
Sub EricG()
For Each Cl In Range("C1", Range("C" & Rows.Count).End(xlUp))
Range("A:A").Replace Cl.Value, "", xlPart, , False, , False, False
Next Cl
End Sub