ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do you insert a phrase at the start of all cells in a column? (https://www.excelbanter.com/excel-discussion-misc-queries/257900-how-do-you-insert-phrase-start-all-cells-column.html)

Elskan

How do you insert a phrase at the start of all cells in a column?
 
I am trying to insert the same phrase followed by a colon and a space in
front of the text in all cells in a column. Is there a simple way to do this
with find and replace?


Don Guillett[_2_]

How do you insert a phrase at the start of all cells in a column?
 
change mc to your column

Sub insertphraseallcellsincolumn()
Dim i As Long
Dim mc As Long
mc = 11 'col K
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Len(Application.Trim(Cells(i, mc))) 0 Then
Cells(i, mc).Value = "new stuff " & Cells(i, mc)
End If
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Elskan" wrote in message
...
I am trying to insert the same phrase followed by a colon and a space in
front of the text in all cells in a column. Is there a simple way to do
this
with find and replace?



Gord Dibben

How do you insert a phrase at the start of all cells in a column?
 
In a helper column enter ="phrase: " & A1

Copy down assuming current text cells are Column A

Adjust to suit.


Gord Dibben MS Excel MVP


On Wed, 3 Mar 2010 15:58:01 -0800, Elskan
wrote:

I am trying to insert the same phrase followed by a colon and a space in
front of the text in all cells in a column. Is there a simple way to do this
with find and replace?



Quin

How do you insert a phrase at the start of all cells in a column?
 
Assuming your existing words are in column €œB€ you could put a Concatenate
function in the €œA€ column and €œfill down€ to combine the two. The function
in your case will look something like this:

=CONCATENATE("The phrase I want to insert",":"," ",B1)

A good way is to use a wizard. Just click on the fx symbol and in the
search box type €œconcantenate€. Press €œgo€ and €œok€. Enter in the €œText 1€
box your phrase. Next box goes your colon, next box goes your space and for
the last, click on the cell with the existing words that are in column €œB€.

Once you have the basic formula in cell A1 you can fill down or just copy /
paste it into cell A2, A3 etc.

If you like the results, you can then convert your result from its current
status as a formula into a more useable form of text by copying column A and
using Paste Special to paste as a value.

If you want to experiment with a different and simple way of adding two
columns with words together just pick a cell and type an equals sign, then
select a cell containing the first text, then type €œ&€ and click on a cell
containing the second text. Press enter

Good luck, you may want to read other posts about the Concatenate Function.
Quin


David Biddulph[_2_]

How do you insert a phrase at the start of all cells in a column?
 
You could, of course, simplify
=CONCATENATE("The phrase I want to insert",":"," ",B1) to
=CONCATENATE("The phrase I want to insert: ",B1) or to
="The phrase I want to insert: "&B1
--
David Biddulph


"Quin" wrote in message
...
Assuming your existing words are in column "B" you could put a Concatenate
function in the "A" column and "fill down" to combine the two. The
function
in your case will look something like this:

=CONCATENATE("The phrase I want to insert",":"," ",B1)

A good way is to use a wizard. Just click on the fx symbol and in the
search box type "concantenate". Press "go" and "ok". Enter in the "Text
1"
box your phrase. Next box goes your colon, next box goes your space and
for
the last, click on the cell with the existing words that are in column "B".

Once you have the basic formula in cell A1 you can fill down or just copy
/
paste it into cell A2, A3 etc.

If you like the results, you can then convert your result from its current
status as a formula into a more useable form of text by copying column A
and
using Paste Special to paste as a value.

If you want to experiment with a different and simple way of adding two
columns with words together just pick a cell and type an equals sign, then
select a cell containing the first text, then type "&" and click on a cell
containing the second text. Press enter

Good luck, you may want to read other posts about the Concatenate
Function.
Quin




All times are GMT +1. The time now is 09:11 PM.

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