Remove Leading Spaces

K

Kirk P.

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?
 
M

Michael Malinsky

Assuming all entries have the apostrophe-single space combo at the beginning
of the product number, try this:

=RIGHT(A1,LEN(A1)-2)
 
J

Jim May

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
 
J

Jim May

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..
 
Top