How do I install and use this option explicit post?

HowdeeDoodee

Well-known Member
Joined
Nov 15, 2004
Messages
599
This question appeared on another board. If allowed, I would like to get an answer from this board. I tried to get the code to work but could not be successful. what do I have to do to make the code work? How do I install the stop words when the stop words number over a thousand?

code:

Option Explicit

Sub RemoveSeparators()
' stanleydgromjr, 07/06/2012
' Removing 'stop words' from a sentence in excel [SOLVED]
Dim s, b
Dim i As Long, ii As Long, lr As Long, h As String
s = Array("this ", "This ", "is ", "Is ", "of ", "Of ", "I ", "i ", "have ", "Have ", "and ", "And ", "from ", "From ", "a ", "A ", "the ", "The ", "it ", "It ", "over ", "Over ", "it's ", "It's ", "has ", "Has ", "that ", "That ", "coming ", "Coming ")
lr = Cells(Rows.Count, 2).End(xlUp).Row
b = Range("B2:C" & lr).Value
For i = LBound(b, 1) To UBound(b, 1)
h = Trim(b(i, 1))
If Right(h, 1) = "." Then h = Left(h, Len(h) - 1)
For ii = LBound(s) To UBound(s)
h = Replace(h, s(ii), "")
Next ii
b(i, 2) = h
Next i
Range("B2:C" & lr).Value = b
End Sub

Sheet:

SnoSentenceResulting sentence
1This laptop is one of nicest machines I have ever owned and this is coming from a Mac enthusiast.laptop one nicest machine ever owned Mac enthusiast
2Form- It's beautiful.form- beautiful
3Espresso Black color is gorgeous and brushed metal look gives it a nice professional feel.espresso black color gorgeous brushed metal look nice professional feel
4A quick brown fox jumped over the lazy dogquick brown fox jumped lazy dog
Pre-specified separators : this, is, of, I, have, and, from, a, the, it, over, it's, has, that, coming
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try:
VBA Code:
Option Compare Text
Sub RemoveWords()
    Application.ScreenUpdating = False
    Dim arr As Variant, i As Long
    arr = Array("This ", "Is ", "Of ", "i ", "Have ", "And ", "From ", "A ", "The ", "It ", , "Over ", , "It's ", "has ", "that ", "Coming ")
    With Range("B2", Range("B" & Rows.Count).End(xlUp))
        For i = LBound(arr) To UBound(arr)
            .Replace arr(i), "", xlPart, , False, , False, False
      Next i
    End With
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
@mumps
I know that you are basically following the given code, but I suggest that you try it with the text:
No sand in Atlanta or Memphis USA


@HowdeeDoodee
Your examples seem a little off.
Row 1 has machines but result has machine
Row 3 has gives but result does not even though gives is not in the separators list

However, you could also give this a try.**
I have assumed that data is in column B, starting at row 2 and results (for now) are going in to column C

**I haven't yet addressed the issue of the very large list of words that you envisage. How/where will the list come from?
Will they be entered directly into the code?
Will they be stored in a column in a worksheet? (If so, where?)
Something else?

Does your text have punctuation? I note that "." marks appeared in your samples but not in the results but there was no mention of them or any other punctuation.
Yet a "-" also appeared in the data and was not removed in the results.
Punctuation can make this sort of task difficult if not impossible to get 100% correct.

VBA Code:
Sub Remove_Words()
  Dim RX As Object
  Dim a As Variant
  Dim i As Long

  Set RX = CreateObject("VBScript.RegExp")
  RX.IgnoreCase = True
  RX.Global = True
  RX.Pattern = "\b(This|Is|Of|i|Have|And|From|A|The|It|Over|It's|has|that|Coming|\.)( |\.|$)"
  With Range("B2", Range("B" & Rows.Count).End(xlUp))
    a = .Value
    For i = 1 To UBound(a)
      a(i, 1) = RX.Replace(a(i, 1), "")
      .Offset(, 1).Value = a
    Next i
  End With
End Sub
 
Last edited:
Upvote 0
Hello Peter. I tried my macro using "No sand in Atlanta" and "Memphis USA". The "is" was removed from "Memphis USA" but the "and" was not removed from "No sand in Atlanta". ????
 
Upvote 0
I tried my macro using "No sand in Atlanta" and "Memphis USA". The "is" was removed from "Memphis USA" but the "and" was not removed from "No sand in Atlanta". ????
My suggestion was actually for the complete text in one cell: "No sand in Atlanta or Memphis USA" because the "a" on the end of Atlanta is then also removed. I don't know why "and" was not removed from "sand" for you. Best guess is that there is something unusual about the space after "sand" in the cell text or the space after "and" in your code.

Here is what happens for me.

Before:

HowdeeDoodee 1.xlsm
B
1Sentence
2No sand in Atlanta
3Memphis USA
4No sand in Atlanta or Memphis USA
Test



After:

HowdeeDoodee 1.xlsm
B
1Sentence
2No sin Atlanta
3MemphUSA
4No sin Atlantor MemphUSA
Test
 
Upvote 0
Thank you for that, Peter. :)
 
Upvote 0
I have 1500 single words not in sentences. My preference is to put all those words in a column rather than in an array. I used someone else's example text because I thought the example would simplify :) things. Can someone give me code to process a column of single words in 850 sentences?
 
Upvote 0
My preference is to put all those words in a column rather than in an array.
So the answer to my question ...
Will they be stored in a column in a worksheet? (If so, where?)


.. in 850 sentences?
So I guess the answer to my question is 'yes'?
Does your text have punctuation? I note that "." marks appeared in your samples but not in the results but there was no mention of them or any other punctuation.
Yet a "-" also appeared in the data and was not removed in the results.
Punctuation can make this sort of task difficult if not impossible to get 100% correct.
What further light can you shed on that issue?
 
Upvote 0
Here is a picture of the actual sheet with the stop words in col A and the sentences in col B.

NewWordReplaceUsingMSWord (Autosaved).xlsx
ABC
1Find Stop Word In Adjoining SentencesSentences Containing Stop Words
2_____We all have our vanity wanting us to tell and show the world how powerful we are. Yet Christ calls us away from our vanity.Words
3_____Few of the tasks of walking the Christian walk can be done without practice. When we make a mistake, we must pick ourselves up and start walking anew.Characters
40sWhat do you really desire? What do you really want? How much do you really desire? How much do you really want? Can you possess a lukewarm "sorta," "kinda," desire to live a godly life and achieve what God wants for you?Sentences
53aTo never talk to God does not make sense.Lines
63bWhen you look back you can see the good and wonderful or the bad and the awful. You have a choice.Paragraphs
73dChrist always listens to your prayers, your petitions, and the pleas of your heart.Numerals
86bWe need to rest our heart in the Lord's love.Punctuation
96oWith the Lord's help, in His will, the broken fences of our past can be mended, new relationships built, and old relationships reborn.Average Read Time
10aGod has given you truly incredible gifts.Average Spell Time
11a1We are all mistake-ridden sinners. However, Christ erases all our mistakes if we repent and accept Him as Lord of our life.Pages (A4)
12a2Christ's suffering for you was meant to take away your searing pain.
13a3Placing your life in Christ's nail-scarred hands turns you away from bitterness and anger over past hurts and circumstances.
14a4Repentance is not only a process to confront your own wrongdoing, but also a process to confront the wrongdoing others have done to you.
15abWhen we are honest, we are conquerors over the darkness trying to pull us down.
16ablePraising God is a wonderful part of spiritual life.
17aboutThe world still rejects our Lord Jesus. The world also rejects those of us who bring His love and message to the world. Yet, we carry on knowing He loves us and He has prepared a place for us.
18aboveYour actions still speak louder than words.
19abstYour acts of kindness and giving break down barriers surrounding a person caught up in the darkness.
20acTake action against hatred, bigotry, insolence, and the haughtiness of evil by showing love, mercy, and kindness.
21accordanceWhen you show acts of kindness, compassion, and love there is a thunderous ovation by the angels.
22accordingWhen you fail, glorify God by coming back with renewed spirit and new determination to be successful for the Lord.
23accordinglyWhen you are willing to follow Christ, you no longer feel a desire to seek out human leadership.
24acrossIn your daily walk, perhaps you are not permitted to speak about how wonderful the Lord is, but you can show Him.
25actOnly God's way is the sure way.
26actuallyGod lives within every living cell of our body. The Lord lives within our heart, mind, and soul.
27adMany doors in life remain closed. The door leading you to Christ is always open.
28addedWe all need to put our sinful pride and ego aside.
29adjOne of the more difficult things about being human is admitting our mistakes.
30aeWe are to use our life to glorify God.
31afIn worldly matters, we need to be smart, wise, and use our resources at hand for God's glory.
32affectedWe have no way to replace the hurt, pain, and humiliation of our past except with the love of Christ.
33affectingFar more important than surrounding yourself with friends is to be a friend…to be a friend of faith.
34affectsWe should be as reverent as Moses. We should understand we stand on holy ground.
35afterMany of the tasks of the Christian walk require years of painful sacrifice.
36afterwardsSatan wants us to shun any daily commitment growing our soul toward Christ. Christ wants us to embrace any daily commitment growing our soul toward Him.
37agYou cannot see the importance of your acts but God can. It is difficult to do, but try to see the importance of your life from God's perspective.
38againYou cannot see the result of your life in the world. However, the result of your life is immensely important to God and to the world.
39againstThe light you shine in the life and heart of others ripples outward throughout the world.
40ahThe blessings of God fall upon you when you unselfishly send His blessings out to others.
41ainLearn to live in peace, harmony, and love by surrendering all you are and all you have to Christ.
42ain'tSome persons tragically have no way to measure their life or they try to measure their life with an open-ended funnel.
43ajWhen you are angry, even angry at God, talk to Him.
44alSome power over bad things is better than no power over bad things.
45allWe should treat each other as if we value each other as much as Christ values us.
46allowDo not be hesitant about showing God's grace to the rude and crude for fear they will laugh at you. Even if they laugh at you, one or two of them may not.
47allowsYou cannot use what you do not know you have.
48almostWe are children of God.
49aloneWhen we are found, we are in the Great Shepherds sheepfold.
50alongChrist beseeches us to plead with others around us to listen to the loving voice of our Lord.
51alreadyLove demands we always follow Christ so we do not become lost.
52alsoNo matter how old you are, nor the conditions under which you must live, getting better every day should be one of your top priorities.
53althoughNo matter what the score might be on the scoreboard, our God reigns…and we win!
54alwaysChrist's goal for you is for you to be His child, kneeling at the foot of His cross.
55amGod will do great things for you if you do great things for God.
56amongWhen we think we will never laugh again, there is the tickle of His love showing us we can laugh, live, and absorb His beauty after all.
57amongstWhen you give up the struggle to get as much as you want for yourself, you can then have a wonderful peace within your heart.
58amoungstWhen you give up struggling to go your own way and go Christ's way, you have His harmony within your soul.
59amountStop trying to generate your own happiness in life because gratitude brings happiness.
60anLet Christ reign within you. Let Christ do His will within you.
61andWhen you let Christ reign within you, then you will have a love surpassing all human understanding.
62announceWe know what God wants us to do when we see the pain, suffering, and hurt of life. He wants us to reach out and touch the hurting, help mend the broken, and support with prayer all those who need Him.
63anotherWhen we watch the sea roar with raging intensity, we must remember God is the creator.
64anyWhen we see the power of a tornado easily whipping up trees as if the trees were matchsticks, we must remember God is greater than the power of the circling mass of energy.
65anybodyNever undervalue your importance to God and to others.
66anyhowThe simplest gestures of love and kindness often turn a life of darkness into a life full of God's light and love.
67anymoreWe often like change when we are young because change is a reflection of the growth and vitality of our maturation. However, when we get older, change becomes more difficult to accept.
68anyoneGod does not relish the fact you feel badly about mistakes you have made. God glories in your honesty.
69anythingMake a special effort to come to know all God has given you.
70anywayThinking poorly of yourself is the result of your ego twisted up to hurt you.
71anywaysWhen we are lost, we are frightened, angry, and often bitter over our plight. However, when we are found, we are secure, happy, and we count each day as a blessing to be God's child.
72anywhereIn this life, you remember the hurt, pain, and disappointment, but when the Lord touches your heart, the pain is erased.
73aoThe touch of Jesus upon your heart helps you understand His sacrifice for you and helps you sacrifice for Him…even in the face of your terrifying fear.
74apWe all need to get along because we are all incredibly valuable to each other.
75apartSome questions for God are questions running deep into His ways, His reasoning, and His plans for which His answers must remain hidden from us.
76apparentlyYour actions of healing, reassurance, love, humility, and contrition help break through barriers of sin in others as well as yourself.
77appearIn the world today, so many lives are caught up in the darkness. What so many people do not know is how the light and love of God dispels the darkness.
78appreciatePeople desperately need you to show them the love and peace only Christ can bring.
79appropriateThe darkness of pain, suffering, and sin can be conquered by inviting the light of God in Christ into one's heart.
80approximatelyWherever you go, whatever you do, at any time or place, inspire others with the love Christ has given you.
81arThe result of bringing Christ's love into the world can be fearful, for the world does not know Christ.
82areA miraculous event occurs when the true love of God fills your pain-filled empty heart.
83arenEach day you can listen to God call your name or you can listen to Satan's appealing call to turn away from God. You choose.
84arentYou need others and others need you.
85aren'tGod loves the heart of a person who wants to win under His rules and guidelines.
86ariseChrist's touch erases the fear and dread put upon you from terrible people or terrible circumstances.
87aroundIn love, we do not see how we are better, or bigger, or stronger, or richer, or taller because in love we are continually expressing our joy in humility.
88asLove engenders Christ-like humility in us by enabling us to reject the idea of being better than someone else.
89a'sThere is no bragging in love because love is "others" oriented.
90asideTo boast means we are deficient.
91askWith love, there is no deficiency, only an overflowing of heart, mind, and soul.
92askingIn a world dominated by greed and selfishness, love finds a way to complete tasks and get jobs done more efficiently.
93associatedSelf-seekers end up being their own worst enemy.
94atIn your life, the more you look out for the interests of others, the more successful you will be.
95auLove demands we live a life of hope.
96authBecause of Christ, for every person on earth, the future is full of promise even when the present is shrouded in darkness and disaster.
97avYour world loves a show. However, God is not in show business.
98availableThe people in your world need you to encourage them and give them support. The same kind of support Jesus gives.
99awWhen you encourage others, you show the strength of Christ in your life.
100awayAs wrong as much of life can be, if we are patient, in the end, God will make all things right, all things new, and all things as they should be.
101awfullyAs we draw close to God when we are hurting, He fills our hurting heart with a peace, understanding, and love not found on earth.
102axIn everyday life, we do not encounter ghosts or a walking Jesus on the lake. However, we do encounter many frightening things keeping us from doing and being all God wants us to do and be.
103ayThe easy path of sin can lead to a darkness for which there is no end.
104azWhen we see how much Christ loves us, how can we not love Him back enough to give our life to Him?
105bLove has a way of multiplying itself in mysterious ways…overflowing with love…you must give love away.
106b1Love has a way of letting things happen in God's time.
107b2Salt is used both as a seasoning and as a preservative. As Christians, we are to be the salt of the earth.
108b3You are amazed and perhaps entertained by seeing the power of faith working in persons lives. Remember the power and the actions of God go largely unseen and unknown.
109baNo matter how much material wealth you acquire or come to own, material things are not enough.
110backYour real reward comes to you as Christ welcomes you into your new mansion in Heaven.
111bcThe healing grace of Christ cannot be measured by any human standard.
112bdWhen we boast, we tragically ignore others as we puff up ourselves.
113beLove for others and love for God dissolves the ego.
114becameWith love, we come to understand position, power, authority, and material things are of no value.
115becauseWith love, we come to understand only Christ is of value.
116becomeWith love, we are not stuck up because we are willing to take a lesser road or a lesser position.
117becomesWhen we come to the Cross and we look upon our Savior, we are crushed. Then He touches us and we see eternity waiting for us because of Him.
118becomingYou can desire to always live a devout and righteous life. When you have these longings and desires, you become one with God.
119beenWhen we think about the will of God, we already know on a minute to minute basis we are to kneel at the foot of the Cross, while displaying His love and compassion to the world.
120beforeTo receive help from God, we must cast aside our ego, our wants, our pride, our selfishness, and our sin.
121beforehandWe can know what God's will for us is when we come to deal with other persons, when we come to deal with Him, and when we are confronted with sin and corruption.
122beginWhen bad things happen and doors are closed, one Door is always open.
123beginningNothing helps us come closer to God than making an admission of our failure before Him.
124beginningsTo find fault with yourself because of your sin is to make the condition of your sin problem worse than your problem needs to be. Repentance is the solution.
125beginsGod does not make demands upon you unless His demands are for your own good.
126behindGod creates new things. God has created old things. God is the creator of all things.
127beingThe spiritual truth about your life and your world is this…you have an eternity waiting for you.
128believeYour real reward is in Heaven, not on earth.
129belowTrusting God means you trust Him enough to give Him your life.
130besideWhen you are lost and cannot find your way home, God is your constant guide and your compass.
131besidesEven when people go astray, as sheep wander off into places they do not belong, people who go astray are to be loved just as Christ loves us.
132bestWhen God's power of love comes over a person's life, all the things of earth, the things we think are so important, seem to pass away.
133betterLove does not have time for pride because love is too busy helping others, supporting others, and glorifying God in all we say and do.
134betweenLove is not rude because in love we tend to the needs of others.
135beyondLove knows the ways, outcomes, and thoughts of others.
136biLove provides a way for us to function regardless of our environment or condition.
137billIn a time of grief, our first instinct should always be to run to God for His healing, comfort, and consolation.
138biolGod is still creating even when your free will gives you the idea God is asleep, dead, or does not care enough to interact with you.
139bjGod gave you a will, a free will, to be used to make decisions about the circumstances in your life.
140bkThe living force you call life, and all the particles making up the chemicals of your universe, came from God.
141blWhat a wonderful God we have. What a wonderful God we serve.
142bnWhen you break or violate the rules of God there are always penalties.
143bothKnowing the rules for living our Lord placed within His Word and within your heart is critical to leading a godly life.
144bottomThe Lord provides you with the hope to fuel your life.
145bpAt the Cross, we find strength to resist Satan and Satan's dark ways.
146brWhen anger floods your heart and mind, let the living water of Christ's love fill your life.
147briefWith the Lord's help, you can clean up your mistakes.
148brieflyOur greatest resource in life is God the Father, Jesus Christ the Son, and the Holy Spirit.
149bsPutting yourself down is a form of distorted selfishness.
150btWhen you do what Love demands, no matter what happens in your life, Christ will always be with you as your treasured friend.
151buThere are no words to describe the infinity and magnitude of our Lord.
152butWe must always remember to keep a balance in our life.
153bxAlthough you may not know it, people depend upon you to show Christ's light and His truth.
154byThe circumstances of your life can be depressing until you start to think, pray, and meditate upon Christ and your future with Him.
155cIf you let your heart melt at Christ's touch, you can be His instrument of peace.
156c1There are times of grief when it seems grief will never end. There are also years and seasons when joy abounds.
157c2When we look backward in sadness or grief, we strain our necks.
158c3The consequences of disobedience to God are severe.
159caThe Lord will provide you with the wisdom you need.
160callJesus is the Light of the world.
161cameWhen your mind is attuned to the Holy Spirit, you are truly able to be in control of your life circumstances.
162canLove bubbles up out of our heart to inspire others. Love bubbles up out of our heart to lift others regardless of their state in life.
163cannotWhen we are continually giving, we have no need or passion to take from others.
164cantLove fills our craving for material things thereby empowering us to make do with what we have.
165can'tLove overrides the desires of our heart so easily tempted by satanic darkness.
166causeWe are not puffed up when we are within God's love.
167causesThe dazzle of a spectacular show ends. Love goes on forever.
168ccAnother way of expressing God's goal for you is to speak about God's will for you.
169cdIf we had our own way, every time we called on God for help, He would deliver what we want, like we want it. However, our way is not important to God. God's way is important to God.
170ceThe truth sets us free but we are too often afraid of the truth.
171certainTrusting God means you give Him all you have.
172certainlyAll people, even those who have power and wealth, will die. However, we have protection from death through Christ who died to give us eternal life.
173cfTrue Christian love within your heart does not use others to any advantage. Love sacrifices personal advantage to advance the life of others.
174cgYou must do the hard work of building your church and your Christian community.
175chThe simplest smile, the smallest gesture, and the smallest touch can mean so much.
176changesLove is not always consumed with the idea of wrong because love is consumed with making things right.
177ciWhen we are reborn in Christ's love we have a new spiritual body disdaining the sinful things of this earth.
178citWhen you invite Christ into your life, a stream of living water pours down from heaven into your heart.
179cjWhen your heart awakens to the outpouring of His love and grace, give Him thanks.
180clGod's way to give each of us a new eternal dawn in our life was to send His only Son into the world to die for us.
181clearlyWith the love of Christ welling up within us we have a fountain of living water within us…a fountain of living water filling our soul giving us a peace we cannot easily explain.
182cmWhen you pray, try to let God speak to you by being silent before Him.
183c'monToo often, we are not silent with God. With God, we speak instead of listening to Him tell us how much He loves us.
184cnAge can bring with it a time in life full of counting the blessings God has poured out upon you.
185coInstead of waiting on God to serve you, in relentless devotion your heart must always be serving Him.
186comBe aware! The world entices you away from your faith.
187comeOver the years, we can lose track of people or we only write to them in our Christmas cards. Let us not forget them. Let us pray for them each day.
188comesChrist came into the world to erase the awful shame and humiliation you may have experienced.
189conChrist came into the world to tell you hard work produces fruit for the Kingdom of God and fruit within your life.
190concerningChrist came into the world to get you to learn to do new things in new ways. Christ came into the world to get you to do old things in new ways.
191consequentlyChristmas is a time to reaffirm your desire to live according to Christ's greatest commandment…to love God with all your heart, all your soul, and all your might.
192considerThe pain of your heart is pushed out by Christ's love and compassion.
193consideringWhether you work for wages or not, you get paid in the end according to the Lord's righteous judgment.
194containThe infinite love of Christ can never be fully known or fully understood by us while we are alive on earth.
195containingLiving in total humility on earth begets for you a beautiful applause on the other shore.
196containsWhen you think thoughts of love and kindness, peace will reign within you.
197correspondingToday, let the pouring out of Christ's love, mercy, compassion, and presence be your guide in leading a life in Christ's name.
198couldEvery day we see reasons why we believe Christ will return to us while we are alive upon the earth.
199couldnGod is forming, shaping, and molding you, if you let Him.
200couldntGod cannot be measured, sized, or gauged.
201couldn'tLook deeply into the lives of those who seem to have it all and you may find they have very little.
202courseLiving in thanksgiving gives an ability to see small flickering lights of love in the hearts of little children.
203cpOthers inflict wounds upon us and our heart is torn. However, we serve a Great Physician who can heal our heart forever.
204cqAll have shinned and fallen short of the glory of God. However, Christ came to stand with us and be our Intercessor so when we fall short, He will be with us to cover our mistakes.
205crIt is easy to slip away into the sinful part of the world. However, God has given each of us a will to turn away from sin.
206cryIf we are not honest about the wiles of Satan in our life, our self-lies will doom us.
207csChrist's birth means your heart can be made new because you can be reborn.
208c'sJesus was born so your selfishness would be replaced by unselfishness, causing your unhappiness to be replaced by happiness.
209ctJesus was born to make God's will your will.
210cuJesus was born to take away your fear of death as you accept Him.
211currentlyIn the warmth of Christ's manger, remember you have not received even a fraction of your real reward to be found in Heaven.
212cvMany times we must be a warrior, but we are not alone because Christ is with us.
213cxThe kind of people we bring into our life determines the ease or difficulty of our life.
214cyPerhaps in your life you know you need to bring the knowledge of Christ to someone but you are afraid to act. Take courage and act.
215czNo achievement of merit happens without a passion to achieve.
216dNo victory for Christ is ever won without a burning desire to serve Him.
217d2You can have a heart desiring to be one with Christ.
218daEven when you cannot control every circumstance and event in your life, you can display reasoned responses to circumstances.
219dateWhen you exert all your energies to be holy and devout, you are able to push all satanic forces aside because you have the Holy Spirit helping you battle against the darkness.
220dcYou can control whether you pray or do not pray. What will you do?
221ddYou can control whether you surrender your life to Christ or keep your life for yourself. What will you do?
222deWith the self-control you have, you can let your mind be touched by the Holy Spirit.
223definitelyLet us all be busy doing work for the Lord.
224describeThe Lord's will is for you to be industrious, to create, and to build according to His will.
225describedLearning about the Lord and learning about your world should be a daily life-long endeavor.
226despiteThere are times when righteous anger is justified, but righteous anger does not mean anger is just.
227detailNot everyone is privileged to see an angel. However, all the people in your life are privileged to see you, a person who can do angel work.
228dfIf you are willing to do so, you can look back and see the Lord's hand in your life.
229diIn every dark hour, when you need someone, you have Christ.
230didThe fullness of your life depends upon what you do with the blessings God gives you.
231didnIf you only commit your life and energy to yourself, you may not surround yourself with persons will carry you when you need to be carried.
232didn'tTragically, we want what we want and need, and we want it now! However, patience is golden, and waiting can bring treasures.
233differentWe all know things and situations in the world are not what they should be. However, there is a place of utmost perfection. This place of perfection is God's home now, and your home later on.
234djGod wants to create a new life within each person who walks the earth.
235dkWithin the heart of sinful men and women, within the deepest recesses of the darkness where we plot against others to hurt or destroy…there is an empty place where the Light could live…what will we do?
236dlIn our times of joy or sadness, we have a wonderful Lord and Savior who reveals the twinkling stars and the bright moon.
237doChrist came into the world to give you the gift of erasing the awful shame and humiliation you may have experienced.
238doesChrist came into the world to give you the gift of knowing hard work produces fruit for the Kingdom of God and fruit within your life.
239doesnChrist came into the world to give you the gift of His teaching you to do old things according to His will.
240doesn'tChristmas is a time to reaffirm your desire to live according to Christ's greatest commandment…to love God with all your heart, all your soul, and all your might.
241doingNo matter what the season of the year may be, the pain of your heart is pushed out by Christ's love and compassion.
242donLove within you has a way of touching others with a power to quell the rage within them.
243doneLove within your heart defends the defenseless.
244don'tYour love shelters the children and adults of every faith, whether there is a disagreement over issues or not.
245downWe often wonder why God does not speak to us or speak with us. Perhaps we should wonder why we have ears yet we do not hear.
246downwardsWe go to God with our minds full of words and thoughts. Let us go to God with our minds full of desire wanting to glorify Him.
247dpWe can give Christ an incredible gift by giving Him our spirit of obedience.
248drOur lives are filled with priorities. Let us keep as a priority the keeping of Christmas all year round within our heart and soul.
249dsEvery day, give Christ the gift of getting better at being His child.
250dtWe should value each other as much as we value the birth and resurrection of Christ.
251duDuring the Christmas season, or any season, when you are unselfish, then happiness is the result.
252dueWe all stand in Christ's presence. If we are willing, we can be washed clean and redeemed by His blood.
253duringLive a life of devout godliness. You will be paid in heaven for your hard work of staying true to the calling of Christ upon your life.
254dxIf we do not get to see Christ's return to earth while we are living, we will live to see His return to earth with a better view from Heaven.
255dyWhen you talk to God, He listens.
256eNo matter what you have done, no matter what mistakes you have made, no matter what…you can talk to God…and He listens.
257e2The order of all things was established by God at the moment all things were created. Then, when Satan entered God's creation, chaos appeared.
258e3The disorder of life is a result of Satan's attack.
259eaWhen you are willing to put your life into Christ's nail-scared hands, then all of the disorder and the disharmony of life fades away.
260eachWhen you surrender your life to Christ, many things make sense for the first time because His order is established in your life.
261ecHumanity seeks a leader in all the institutions humanity creates. Terribly, humanity makes tragic mistakes.
262edYou can long to only display Christ's love and compassion to others. When you have this longing, He will live within your heart and life.
263eduHappiness does not come to you via the mail or by telephone. Happiness is the result of the kind of person you are.
264eeThe love of Christ makes all things new. The love of Christ puts all things into God's proper order.
265efAs a follower of Christ, do not be surprised when others think ill of you or speak unkind things about you.
266effectStarving souls display acts of silent desperation often seen as a frown, a deep sigh, or a verbal disdain of God's love.
267egAll of us can glorify God, even when we are exhausted and beaten down.
268eiIn the silence of our response to changes in life, we can send our heart and prayers to God, asking Him to use us in every changing circumstance.
269eightIn a world of change and chaos, we have an unchanging and constant God.
270eightyThe bonding in our relationships adds great substance to our life.
271eitherThe persons we take for granted, like our friends and family, can give us contact with the love we call God.
272ejThe Lord has a big eraser ready to erase the hurt, pain, humiliation, and disappointment of your life.
273elWe walk our path of our faith without fully knowing all God is and wants from us. Yet we walk in love.
274elevenWe may not be able to see into the future to see how future events will unfold. Yet if we look far enough, we can see Christ Jesus waiting for us.
275elsePersons in darkness need you.
276elsewhereNo matter what kinds of frustrations appear in your life, love erases them.
277emThrough Christ, we can be empowered with confidence when we are weak-kneed and ridden with anxiety.
278emptyWe serve a mighty God who requires our humble service, yet this same God who requires we be humble, also requires we open our heart, mind, and soul to His power that makes our imagination soar.
279enOur mighty God comes to us in our hour of greatest pain. He tickles our funny bone. He infuses us with optimism and hope when we feel all is lost.
280endWhether we live in a poor rundown neighborhood or a mansion in Beverly Hills, we need not be separated from our God who loves us beyond measure.
281endingWe often ignore God and we do not speak to Him enough. However, He always seeks to speak to us as He tries to pour His truth and wisdom into our heart.
282enoughWe seek leaders in government, business, education, science, medicine, philosophy, and religion. Do we seek leaders who are men and women of God?
283entirelyYou can make a conscious choice to build up or encourage all the persons around you.
284eoYou can choose to support organizations providing employment.
285epAnger, like a tornado, is a rage of emotion running through us that can destroy us and those around us.
286eqYou can choose to support the church where you find messages of Christ's love.
287erEvery human being will die. Even Jesus, who was God made into man, physically died. However, every human being has a chance to live forever because Christ lived, died, and came back to life for each of us.
288esWe live in such a rapid age we expect a quick fix for anything that goes wrong.
289especiallyWe live in an age of childish impatience.
290estWhen Satan brings us down, we may have little heart left to praise God. Although our praise voice may be quieted, we can still reach up to His nail-scarred hand.
291etWhen we are attacked by the darkness of the world, we must carry our burdens to Christ as we kneel at the foot of His Cross.
292et-alAs persons of faith, we must continually take our life to Christ.
293etcWhen we admit our failures, we bring joy to Christ's heart. Then we can experience His joy within us.
294euIf you gave someone a wonderful gift but the person never bothered to open the package, wouldn't you be a bit upset? In the same way, God has given you many gifts yet to be opened.
295evIn wisdom, when we need help, it is smart and astute to get the help we need.
296evenWe carry His kingdom within us.
297everBe the salt of the earth by giving love, giving understanding, and shining the light of Christ's truth into the heart of others.
298everyGod loves you deeply and with such force only your surrendered soul can take it all in.
299everybodyWhen you give in love, the gift becomes larger than yourself. Angels then sing the praises of your Savior.
300everyoneWhen you silence your mind and quiet your heart, you give Christ a chance to fill you with His love and grace.
301everythingAdvancing age can put you on new ground to glorify Him hour by hour.
302everywhereEven when there is an opportunity for righteous anger, we must remain at peace.
303exJust about everyone asks God to give answers to questions. However, many of the answers we seek are already known to us.
304exactlyMost of the questions we have for God have already been answered in God's Holy Word.
305exampleIf you seek with your mind and heart, many of the questions you have for God have an answer in how nature and life are organized.
306exceptWe must learn and be content with the fact not all questions we give to God will get an answer.
307eyIt is just like Jesus, in all His wonderful ways, to give us His gift of forgiveness while His earthly life was about to be taken from Him.
308fPerhaps tomorrow will be the day.
309f2When there is no plan for the future there is only a haphazard and accidental result in living our life.
310faIt makes no difference about what you see when you look backward because looking backward is not what you are supposed to do. What you are supposed to do is look forward.
311farWhen we cast aside the parts of us separating us from God, He then helps us in ways we cannot imagine.
312fcMaterial things do not fill the soul. Only Christ can fill your soul.
313few[XD]
Sheet1
 
Upvote 0
As I mentioned before, punctuation is a problem for this sort of code and you have plenty of it, including at least . , ? "
You also talked about having "words" in column A but you have some very strange looking "words" in there.

In any case, you could give this a try with a copy of your data. It still puts the results in column C so that you can compare the original text to the new text.

VBA Code:
Sub Remove_Words_v2()
  Dim RX As Object
  Dim a As Variant
  Dim i As Long
  
  Set RX = CreateObject("VBScript.RegExp")
  RX.IgnoreCase = True
  RX.Global = True
  RX.Pattern = "\b(" & Join(Application.Transpose(Range("A2", Range("A" & Rows.Count).End(xlUp)).Value), "|") & ")( |\.|\?|\!|$)"
  With Range("B2", Range("B" & Rows.Count).End(xlUp))
    a = .Value
    For i = 1 To UBound(a)
      a(i, 1) = RX.Replace(a(i, 1), "")
      .Offset(, 1).Value = a
    Next i
  End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top