Adding text at the start of a cell

N

N1KO

I have a series of cells with lists in them and i need to add an e-mail
address (always the same) to all the cells at the beginning of the list.

I'm having trouble putting code into the macro i have (which populates the
lists) as it just puts it infront of every value in the list and not just at
the start of the list.......

Does anyone have any stand alone code to insert text into a cell without
deleting all the other stuff in it?

Thanks in advance
 
B

Bob Phillips

What is the rule to determine the start of the list?

Can you give some examples?
 
C

CurlyDave

Add text to an existing string in Column A...

Sub AddTextToCell()
Dim r As Range
Dim c As Range
Dim s As String
s = "YourString"
Set r = Range("A1", Range("A65536").End(xlUp))
For Each c In r.Cells
c = s & c
Next c
End Sub


Move text in Column A to Column B and replace Column A with New
text...

Sub TextToNextColumn()
Dim r As Range
Dim c As Range
Dim s As String
s = "YourString"
Set r = Range("A1", Range("A65536").End(xlUp))
For Each c In r.Cells
c.Offset(0, 1) = c
c = s
Next c
End Sub
 

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

Top