Adding to current cells

  • Thread starter Thread starter Tom
  • Start date Start date
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
 
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).
 
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
 
See also response in programming group which you multi-posted to.


Gord Dibben MS Excel MVP
 
Apologies.

Your posting in programming was NOT identical to this one.


Gord
 

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