Adding to current cells

T

Tom

Hello,
Need help adding a charicter to the end of contents in the cell
without overwriting the cell contents. Example - Cell has "81234/12"
and I want to add another "/" after "12" so it reads "81234/12/". I
have done this before but have forgotten - was thinking that I used
the find and replace function?

Thanks,
Tom
 
R

RiTSo

Tom wrote:

:: Need help adding a charicter to the end of contents in the cell
:: without overwriting the cell contents. Example - Cell has
"81234/12"
:: and I want to add another "/" after "12" so it reads "81234/12/". I
:: have done this before but have forgotten - was thinking that I used
:: the find and replace function?
::
:: Thanks,
:: Tom

You could use find and replace if all the end values are the same.

If A1 is "81234/12" I'd put in A2

=(A1&"/")

this should then display as you want to, then all you need to do is
copy A2 and use PASTE SPECIAL and select VALUES to paste the value
over the original formula (or to another location).
 
T

T. Valko

Try this macro:

Sub AddSlash()

Dim cell As Range
For Each cell In Selection
If cell.Value <> "" Then
cell.Value = cell.Value & "/"
Else: cell.Value = cell.Value
End If

Next cell

End Sub

Select the range in question and run the macro.

Biff
 
G

Gord Dibben

See also response in programming group which you multi-posted to.


Gord Dibben MS Excel MVP
 
Top