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

Hi

I need a macro to insert a space every 4 characters e.g.

It will change the contents of :

CY11A01

To

CY11 A01

Any ideas??

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Macro to insert a space

do you only need to add a space after the first 4 characters?

Sub test2()
slen = Len(Range("a1"))

Range("b1").Value = Left(Range("a1"), 4) & " " & Right(Range("a1"), slen - 4)

End Sub

--


Gary


"Lame Dame via OfficeKB.com" <u15117@uwe wrote in message
news:5db1018f45b69@uwe...
Hi

I need a macro to insert a space every 4 characters e.g.

It will change the contents of :

CY11A01

To

CY11 A01

Any ideas??

--
Message posted via http://www.officekb.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to insert a space

thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200603/1
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
How to insert a space between display results Neall Excel Worksheet Functions 2 July 5th 07 05:10 PM
Insert Space sabegirl Excel Discussion (Misc queries) 2 May 28th 06 04:44 AM
How do I insert space between 2 consecutive columns of an XL Shee. Shamshad Butt Excel Discussion (Misc queries) 4 October 20th 05 12:28 PM
insert a space in a phone #. change (123)456-7890 to (123) 456-78 leo Excel Worksheet Functions 6 January 15th 05 01:57 AM
How can I insert a space before the last character in a range of cells Jeff[_25_] Excel Programming 8 November 13th 03 07:45 PM


All times are GMT +1. The time now is 11:03 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"