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

  • Thread starter Thread starter pol
  • Start date Start date
P

pol

How do I insert a word or words in front of existing text
cells on a multiple cell basis ?
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top