Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding JR to excel cells

Status
Not open for further replies.

Yoxy99

MIS
Jul 28, 2007
23
US
Hi I was wondering if there was a quick way I could add "JR" at the end of cells I have selected in Excel. Currently the cells contain names without JR for example: John Smith but I want it to add JR at the end so it would be : John Smith JR?
 




You don't need VBA.
[tt]
assuming the data is in column A, beginning in row 2...
1. B2: =A2&" JR"
2. Copy B2 down thru the rows of data
3. Copy the column B range containing data
4. select A2
5. Edit > Paste Special - VALUES
[/tt]
THAT's the quickest way!

But here's a VBA solution, for the "cells I have selected in Excel."
Code:
sub AppendJR()
   dim r as range
   for each r in selection
      with r
         .value = .value & " JR"
      end with
   next
end sub


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top