Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8554875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:59:06+00:00 2026-06-11T14:59:06+00:00

I previously asked how I could check whether a piece of text contains a

  • 0

I previously asked how I could check whether a piece of text contains a string, now I would like to delete that piece of string if it is found in that cell.

If the value in column C is different from column W, I check whether
column A contains “MIG”, if it does I add it to the cell, if not I do
nothing.

Because this macro is run everytime you save, if you were to edit the values in W & C to make them match then column A will still say “MIG”.

So when the document is saved, the macro will now see column C & W are
the same and if it contains “MIG” it should delete “MIG” from the
cell.

Sample

If shtVO.Cells(Row, 3).Value <> shtVO.Cells(Row, 23).Value Then
  If shtVO.Cells(Row, 1).Value Like "*MIG*" Then
  Else
    shtVO.Cells(Row, 1).Value = shtVO.Cells(Row, 1).Value + "MIG"
  End If
Else
  If shtVO.Cells(Row, 3).Value = shtVO.Cells(Row, 23).Value Then
    If shtVO.Cells(Row, 1).Value Like "*MIG*" Then
        .....              
    End If
  End If
End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:59:07+00:00Added an answer on June 11, 2026 at 2:59 pm

    Not sure I understand your logic, but to clear a cell value use

    shtVO.Cells( ... ).ClearContents
    

    EDIT

    Use of Replace

    shtVO.Cells( ... ).Value = Replace(shtVO.Cells( ... ).Value, "MIG", "")
    

    The rest of your comment deals with the possibility that you are left with double space after replaceing MIG
    Eg "Fisrt MIG second" –> "Fisrt  second"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Refering to a previously asked question , I would like to know how to
I previously asked a question about chaining conditions in Linq To Entities. Now I
I previously asked why \n in a string was not returning a line break.
I asked a similar question previously, but it was so vague that I couldn't
I have previously asked the following question: Calculating percentage within the SQL Now i
I asked a question previously - HERE - about how I could set my
Previously I asked you about ways to test sending multiple emails at once. Now
I previously asked this question, which was answered, but someone gave a suggestion that
I previously asked a question about fetching the last 100 mentions for a person
I previously asked, How to determine the target of a symbolic link or Reparse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.