Excel 2007 - Sudden Disappearance of Character Spacing

J

Jing Xiang

Hi,

I am using Excel 2007 at work for data entry.

Yesterday, I could have accidentally pressed a wrong function where al
spacing between wordings is removed.

Examples will be "South China Sea" will be renamed to "SouthChinaSea
and "Great Barrier Reef" will be renamed to "GreatBarrierReef".

My document has about 12,000+ records and it would be very tim
consuming to Enter Spacing for each record.

Therefore, I would really grateful, if someone can please advise me ho
do I go about in inserting back the spacings.

Thank You
 
C

Claus Busch

Hi,

Am Mon, 19 Nov 2012 16:44:28 +0000 schrieb Jing Xiang:
Yesterday, I could have accidentally pressed a wrong function where all
spacing between wordings is removed.

in case of accident in the future: if you can't undo last action close
the workbook without saving.
Examples will be "South China Sea" will be renamed to "SouthChinaSea"
and "Great Barrier Reef" will be renamed to "GreatBarrierReef".

If all strings will be names and the spaces are missed in front of
capital letters, try following code in a selected range:

Sub InsertSpace()
Dim RngC As Range
Dim i As Integer

For Each RngC In Selection
For i = 65 To 90
If InStr(2, RngC, Chr(i)) > 0 Then
RngC = Replace(RngC, Chr(i), " " & Chr(i))
End If
Next
Next
End Sub


Regards
Claus Busch
 
J

Jing Xiang

Hi Claus Busch,

Thanks so much for your help! The source code works!

Your the best!!

Cheers,
Jing Xian
 

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

Similar Threads


Top