Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
DS DS is offline
external usenet poster
 
Posts: 117
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add additional text in many cells The Austrian Excel Discussion (Misc queries) 3 November 12th 07 04:13 PM
Additional Help with range of cells [email protected] Excel Worksheet Functions 1 September 21st 07 03:37 PM
Inserting Additional Text in Spreadsheet SEBA Branch Inventory Excel Worksheet Functions 3 June 27th 07 05:58 PM
Need your help. I need to add additional information into cells Shani Excel Programming 5 May 4th 06 06:56 PM
How to input additional text to multiple of existing cells that has text [email protected] Excel Worksheet Functions 2 June 21st 05 01:46 AM


All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"