Remove Leading Spaces

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got a column of cells filled with Product ID's. They all have a space
at the beginning, such as

' 9025342
' 1023456

I've tried Trim, LTrim, Clean, etc, etc. Nothing seems to work on these
cells. Any ideas?
 
Assuming all entries have the apostrophe-single space combo at the beginning
of the product number, try this:

=RIGHT(A1,LEN(A1)-2)
 
In a standard module paste in:

Sub nopreapostophe()
For Each c In Selection
If c.PrefixCharacter = "'" Then c.Value = c.Value
Next
End Sub

Back at the worksheet, Highlight/Select your desired range of Cells to
examine/fix.
And then run: nopreapostophe()
HTH
 
Sorry, I got your Q confused with another Q asked by someone - their Q,
which had to do
only with the removal of the " ' " preceeding a bunch of numbers..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top