Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / September 2007

Tip: Looking for answers? Try searching our database.

Prepending values in a column with "\"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Fuller - 25 Sep 2007 01:40 GMT
I would like to prepend all text values in a column with "\". What is the
easiest way to do this if there are thousands of rows?
Gord Dibben - 25 Sep 2007 01:48 GMT
Assuming column A has the text values.

In B1 enter  ="\" & A1

Double-click on fill handle of B1 to copy down.

Copy then paste special(in place)>values>OK>Esc.

Delete original column A if desired.

Or you could use a macro to do in place with no formulas.

Sub Add_Text_Left()
Dim cell As Range
Dim moretext As String
Dim thisrng As Range
   On Error GoTo endit
   Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
           .SpecialCells(xlCellTypeConstants, xlTextValues)
   moretext = InputBox("Enter your Text")
   For Each cell In thisrng
       cell.Value = moretext & cell.Value
   Next
   Exit Sub
endit:
   MsgBox "only formulas in range"
End Sub

Gord Dibben  MS Excel MVP

>I would like to prepend all text values in a column with "\". What is the
>easiest way to do this if there are thousands of rows?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.