View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Paste text- help

You say "in the text". Do you mean between two strings in the cells or just
left or right side.

No one command possible unless you use a macro.

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

For in between more complex code would be required depending upon your needs.


Gord Dibben MS Excel MVP

On Mon, 14 May 2007 04:10:01 -0700, Anand vijay
wrote:

Hi..

I want to know that if in cell A1 to A20 I have some text and i want to pase
addtional text in the existing text in all the cells from A1 to A20 . How do
I do it in one command.