ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Paste text- help (https://www.excelbanter.com/excel-discussion-misc-queries/142616-paste-text-help.html)

Anand vijay

Paste text- help
 
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.



FSt1

Paste text- help
 
hi,
I don't think you can. but you can use a formula.
=CONCATENATE(A1,B1) Copy down.
adjust to your data.
to change formula to hard data, editpastespecialvalues (at A1). delete
other data.

Regards
FSt1




"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.



Gord Dibben

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.




All times are GMT +1. The time now is 08:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com