+ Reply to Thread
Results 1 to 2 of 2

I need your help. I want to add additional text within cells

  1. #1
    Shani
    Guest

    I need your help. I want to add additional text within cells

    I want to go through all cells in Column A and add "/", without the
    quotes, at the end of the text. However if there is already a slash.
    "/", at the end then i do not want to add anything.

    so i would like my cells to look like:

    google.com/
    yahoo.com/
    aol.com/


  2. #2
    DS
    Guest

    RE: I need your help. I want to add additional text within cells

    Hi Shani,

    try:

    Sub AddSlash()

    For Each cell In Range("A:A")
    If Right$(cell, 1) <> "/" Then
    cell.Value = cell.Value & "/"
    End If
    Next

    End Sub

    Note that this will go through ALL cells in col A, including blank entries
    (which will become "/"). If you've got limited entries following by thousands
    of blank cells, then either reduce the range to a specific (e.g. A:A change
    to A2:A100) or use a Do Until cell = "" loop rather than a For...Next. If
    you expect blanks with your range and want to leave them blank, add an extra
    condition around the code to only run if cell <> ""

    HTH
    DS


    "Shani" wrote:

    > I want to go through all cells in Column A and add "/", without the
    > quotes, at the end of the text. However if there is already a slash.
    > "/", at the end then i do not want to add anything.
    >
    > so i would like my cells to look like:
    >
    > google.com/
    > yahoo.com/
    > aol.com/
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1