Adding text at the start of a cell

  • Thread starter Thread starter N1KO
  • Start date Start date
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
 
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
 
Back
Top