a macro for inserting

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

Guest

I need a solution/macro to insert a minussign (-) into a 10 digit number
between digit 6 and 7 (to get a number looking like this xxxxxx-xxxx)

I need to do it in a single column for all 65 536 lines of code in the
spreadsheet.

who of you is nerd enough to tackle this challenge?
 
Hi spreadsheet monkey

You can try this

Dim cell As Range
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
cell.Value = Mid(cell.Value, 1, 6) & "-" & Mid(cell.Value, 7, 4)
Next cell


With a formula you can do this in col B

=MID(A1,1,6)&"-"&MID(A1,7,4)
 

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