Address can not be more than 30 characters

  • Thread starter Thread starter NeSchw6G
  • Start date Start date
N

NeSchw6G

Hello,
I have a report that is opened through excel and it includes an address
column. I am sending this report to a thrid party who can not have the
address field be more than 30 characters. Is there a formula that would
recognize if the field is more than 30 characters and then move the extra
characters to the next column? the report includes over 1,000 records so it
would be nice if I did not have to do any manual work.

Thank you,
 
It all depends on where you are allowed to strip characters from. If you just
want the first 30 then insert a column and type =Left(A1,30) copy it down and
there you go. You can copy and paste special-values over the old and delete
the column if you need to. This assumes that the address is in A1 btw.
 
Sub limitcol()
mc = "J"
On Error Resume Next
lr = Cells(Rows.Count, mc).End(xlUp).Row
For Each c In Range(Cells(1, mc), Cells(lr, mc))
c.Offset(, 1) = Right(c, Len(c) - 30)
c.Value = Left(c, 30)
Next c
End Sub
 
Okay, so now that I can identify the address with 30 characters, how do I
moved the 31+ characters to a separte column?
 
Don, It looks like you have a good idea except that I have no idea what "Sub
limitcol()" means, so I don't know how to execute this. Can you simplify for
me?

Thank you!
 
Back
Top