Leave only last 32 chars

emukiss10

Board Regular
Joined
Nov 17, 2017
Messages
201
Hello,

Column I have some info + acc number. Id like to strip this column of everything beside acc.

how delete everything beside last 32 chars?

=Right(I2;32) but to all in column I and with VBA

Thank You :)
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
=Right(I2;32) but to all in column I and with VBA

Hi, you can try this on a copy of your workbook.

Code:
Sub m()
With Range("I2:I" & Range("I" & Rows.Count).End(xlUp).Row)
  .Value = Evaluate("INDEX(RIGHT( " & .Address & ",32),0)")
End With
End Sub
 
Upvote 0
Ive manage to deal with this little problem with something like this

Dim c As Range
Dim lastrow1 As Long, i As Long

lastrow1 = Range("I" & Rows.Count).End(xlUp).row
i = 2
For Each c In Sheets(1).Range("I1:I" & lastrow1)
c.Value = Right(c.Value, 32)
Next c



BUT

Yours is as always better... Thank You :)
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top