Copying and pasting/formatting

  • Thread starter Thread starter Mineralistic
  • Start date Start date
M

Mineralistic

I am dealing with database lists of hundreds of items, and one thin
that slows me down is having to paste the same URL in front of eac
individual number for each item. The numbers are not completel
consectutive (i.e. 1, 3, 4, 6, etc.). I am wondering if there's a wa
to copy a string of text, and then select a number of cells, and past
the string -in front- of whatever text is within those cells.

Any help is appreciated, thanks
 
Assuming numbers are in Column A.

In B1 enter ="stringtoadd" & A1

Double-click on the fill handle to copy down as far as you have data in Column A

When happy, copy column B and Paste Special(in place)>Values>OK>Esc.

Delete Column A.

VBA Macro......select column A and run the macro.

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
 

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