Macro Help??

R

rblivewire

I just need a macro that will add "_ed1" to the end of an already
existing column of numbers.
Any suggestions?
 
T

Trevor Shuttleworth

One way:

Sub Add_ed1()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In _
Range("A1:A" & Range("A65536").End(xlUp).Row)
cell.Value = cell.Value & "_ed1"
Next 'cell
Application.ScreenUpdating = True
End Sub

Regards

Trevor
 
R

rblivewire

What do I change to make it at the users selection which cells to
change? Also, do you know why it keeps locking up everytime I run it
for more than 20 cells?
 
D

Dave Peterson

I don't see any reason why it would lock up with more than 20 cells, but you
could change the code to something like:

Sub Add_ed1()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Selection.cells
cell.Value = cell.Value & "_ed1"
Next 'cell
Application.ScreenUpdating = True
End Sub
 
Top