View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Adding periods to sentences.

One sentence per cell and all at once?

Data in A1:A10

Select B1:B10

In B1 enter =A1 & "." then hit CTRL + ENTER

Copy/paste specialvaluesOKEsc

Delete original A1:A10.

You could also use a macro if desired.

Select the cells and run.

Sub Add_Text_Right()
Dim cell As Range
Dim moretext As String
Dim thisrng As Range
On Error GoTo justformulas
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants, xlTextValues)
moretext = InputBox("Enter your Text")
For Each cell In thisrng
cell.Value = cell.Value & moretext
Next
Exit Sub
justformulas:
MsgBox "only formulas in range"
End Sub

When the InputBox comes upm enter a period and OK


Gord Dibben MS Excel MVP





On Thu, 28 Sep 2006 14:34:02 -0700, RJJ wrote:

How do I add periods to the ends of sentences in multiple cells at once?