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 9081981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:26:50+00:00 2026-06-16T20:26:50+00:00

I am looking for a regex for excel 2007 that can replace all instances

  • 0

I am looking for a regex for excel 2007 that can replace all instances of -3 ONLY at the end of the string, replacing it with absolutely nothing (removing it). There are instances of -3 throughout the strings, however I need to remove only the ones at the end. This is being integrated into a macro, so find and replace using a single regex is preferred.

  • 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-16T20:26:51+00:00Added an answer on June 16, 2026 at 8:26 pm

    You can do this without Regex by using VBA’s Instr function. Here is the code:

    Sub ReplaceIt()
    
    Dim myRng As Range
    myRange = Range("A1") ' change as needed
    
    If InStr(Len(myRange.Text) - 2, myRange.Text, "-3") > 0 Then
    
        myRange.Value = Left(myRange, Len(myRange) - 2)
    
    End If
    
    
    End Sub
    

    Update

    Based on Juri’s comment below, changing the If statement to this will also work, and it’s a bit cleaner.

    If Right (MyRange, 2) = "-3" Then MyRange=Left(MyRange, Len(MyRange)-2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a regex that could replace all [ with an -> but
I'm looking for a regex to ensure that my string only contains \r\n for
I'm looking for the regex to match any string that has an opened or
I am looking to remove all alpha-numeric characters from a string and replace with
I am looking for a regex to replace all terms in parentheses unless the
I'm looking for a regex that accomplishes the following: **Only single**, alphanumeric p**art**s of
Looking for some Regex help in Ruby. I have a string that is formated
I'm looking for a regex that will find and replace certain patterns in a
Looking for a RegEx that would match words that contains only 2 instance of
I'm looking for a regex that will only allow Arabic integers from 0 to

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.