How do I delete part of a cell

  • Thread starter Thread starter STEVE
  • Start date Start date
Hi Steve

Try this formula in the column next to it

=LEFT(A1,LEN(A1)-2)

With VBA you can do it in the same cell
If you want that post back
 
Hi John

With your data in column A

Sub test2()
Dim cell As Range
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
If Len(cell) >= 2 Then
cell.Value = _
Left(cell, Len(cell) - 2)
End If
Next
End Sub
 
If all the strings are the same length, and you're always looking to
eliminate the last two characters, you can use,
<Data> <TextToColumns>,
<Fixed Width> <Next>,
Click to create a column break line to separate the last two characters,
Then <Finish>.
This moves the last two characters out of the original column into the next
adjoining column, where they can be deleted if necessary.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

For example,

1081004cw How can I get the last two characters
chopped off of that.
 
Thanks Ron


Ron de Bruin said:
Hi John

With your data in column A

Sub test2()
Dim cell As Range
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
If Len(cell) >= 2 Then
cell.Value = _
Left(cell, Len(cell) - 2)
End If
Next
End Sub
 
This moves the last two characters out of the original column into the next
adjoining column, where they can be deleted if necessary.

Just select that column within the wizard and choose 'Do Not Import Column'
 
I do believe Ken, that doesn't eliminate the last two characters from the
original column, but *duplicates* the last two characters to an adjoining
column.
You *shouldn't* use "DoNotImport" if you want to remove the last two
characters.
--


Regards,

RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit!
-------------------------------------------------------------------

Ken Wright said:
This moves the last two characters out of the original column into the next
adjoining column, where they can be deleted if necessary.

Just select that column within the wizard and choose 'Do Not Import Column'
 
RD

Works for me.

Select the column with the last two letters and "Do not Import".

Gone!! One column of altered data remains.

Gord
 
OHhhh!
Is that what Ken meant!
*AFTER* the first go-round!

Thought he meant *during* the original division.

Pardon me Ken ... Sorry!

Thanks for the enlightenment Gord.
--


Regards,

RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit!
-------------------------------------------------------------------

"Gord Dibben" <gorddibbATshawDOTca> wrote in message
RD

Works for me.

Select the column with the last two letters and "Do not Import".

Gone!! One column of altered data remains.

Gord
 
RD

Ken and I do mean "during" the original division with Text to Columns
operation.

100234cw in cell.

Text to Columns>Fixed width>Next>Click a break line after 100234.

Next>Select cw column and "Do not import">Finish.

Gord
 
Dummy, Dummy, Dumb Me!
--

Regards,

RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
--------------------------------------------------------------------

"Gord Dibben" <gorddibbATshawDOTca> wrote in message
RD

Ken and I do mean "during" the original division with Text to Columns
operation.

100234cw in cell.

Text to Columns>Fixed width>Next>Click a break line after 100234.

Next>Select cw column and "Do not import">Finish.

Gord
 
Back
Top