Inserting a string of text in front of existing text in excel

P

pol

How do I insert a word or words in front of existing text
cells on a multiple cell basis ?
 
F

Frank Kabel

Hi
try something like the following macro (works on your
selection):
sub foo()
dim rng as range
dim cell as range
dim str_part
set rng=selection
str_part="precede_"
for each cell in rng
if cell.value<>"" then
cell.value=str_part & cell.value
end if
next
end sub
 
V

Vaughan

If a formula will do, try something like this (with the existing text in A1):

="Test to be inserted "&A1

You can copy te formula down. Then if you need the text to be just text, you can copy and paste special, values.
 
Top