Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default a macro for inserting

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default a macro for inserting

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)


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"spreadsheet monkey" <spreadsheet wrote in message
...
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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
a macro for inserting Chris Wilkinson Excel Programming 0 March 28th 07 01:51 AM
macro for inserting a row Kazuki Excel Programming 1 August 22nd 06 06:38 AM
inserting row macro daroc Excel Discussion (Misc queries) 2 March 7th 06 06:27 PM
Inserting A Row Macro PW11111 Excel Programming 2 December 16th 04 10:27 AM
Inserting a Row With Macro - Help iltf124 no spam @hotmail.com Excel Programming 6 April 8th 04 08:21 PM


All times are GMT +1. The time now is 03:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"