Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formating column cells

I have a column full of single-word names. I want to
insert a dot (.) after every two consecutive letters. For
example if the name is: Amjad, then it will become:
Am.ja.d

Is there a quick way of doing that? like selecting the
whole column then format its contents in the manner
described above?

Thanks
Amjad

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Formating column cells

Amjad,

Sub testit()
Const cInterval = 2
Dim rng As Range, strTemp As String, i As Long

With ActiveSheet
For Each rng In Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
i = 1: strTemp = ""
Do Until i Len(rng.Value)
If i 1 Then strTemp = strTemp & "."
strTemp = strTemp & Mid(rng.Value, i, cInterval)
i = i + cInterval
Loop
Debug.Print strTemp
Next
End With
End Sub

Rob

"Amjad" wrote in message
...
I have a column full of single-word names. I want to
insert a dot (.) after every two consecutive letters. For
example if the name is: Amjad, then it will become:
Am.ja.d

Is there a quick way of doing that? like selecting the
whole column then format its contents in the manner
described above?

Thanks
Amjad



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
Formating a single column of info into 3 columns Mike Clarke New Users to Excel 2 October 31st 09 07:18 PM
Conditional Formating if Greater Than or Less Than other column CClio333 Excel Worksheet Functions 2 February 26th 08 09:23 AM
conditional formating cells i Excel based on other cells values Elias Petursson Excel Worksheet Functions 3 May 23rd 06 06:45 PM
Column formating help! Bill Excel Worksheet Functions 1 September 4th 05 08:53 PM
formating a column Stacey Excel Worksheet Functions 1 February 10th 05 10:22 PM


All times are GMT +1. The time now is 06:37 PM.

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"