• Status: Solved
  • Priority: Medium
  • Security: Private
  • Views: 11
  • Last Modified:

Find cells based on content and trim to left 3 characters

I need to include some code in my project that will select any cell containing "tier" and then trim to the first three characters.

The cell will always be in column A but could be any row.
There will be cells in two different sheets in the workbook.

Typical:   "300.00 - Tier 3" or "500.0 - Tier 2"  should result in "300" & "500"

Thanks!!
MWT-sample.xlsx
0
Euro5
Asked:
Euro5
1 Solution
 
Rgonzo1971Commented:
HI,

pls try

Sub macro()

For Each cell In Intersect(Columns("A"), UsedRange)
    If cell Like "*Tier*" Then
        cell.Value = Left(cell, 3)
    End If
Next
End Sub

Open in new window

Regards
0
 
Euro5Author Commented:
Excellent, thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now