Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Macro to insert a space

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lame Dame - 23 Mar 2006 17:21 GMT
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??
Gary Keramidas - 23 Mar 2006 17:42 GMT
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

Signature

Gary

> Hi
>
[quoted text clipped - 9 lines]
>
> Any ideas??
Lame Dame - 23 Mar 2006 18:37 GMT
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.