From: BlueAngel on
I would like to have a macro that when run would prompt the user to select
rows of data and then prompt the user to input information for the cell. The
new information would be appended to the beginning of cell "D" for each row
selected. There will be 4 digits in each cell "D". Therefore, if "D"
currently contains 1234 and the user selects this cell, runs the macro and
enters 555, then cell "D" woul display 5551234. Can someone help?

Thanks in advance,

BlueAngel
From: Gord Dibben on
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

Assumes user will select a range of cells prior to running.


Gord Dibben MS Excel MVP

On Mon, 8 Mar 2010 07:30:01 -0800, BlueAngel
<BlueAngel(a)discussions.microsoft.com> wrote:

>I would like to have a macro that when run would prompt the user to select
>rows of data and then prompt the user to input information for the cell. The
>new information would be appended to the beginning of cell "D" for each row
>selected. There will be 4 digits in each cell "D". Therefore, if "D"
>currently contains 1234 and the user selects this cell, runs the macro and
>enters 555, then cell "D" woul display 5551234. Can someone help?
>
>Thanks in advance,
>
>BlueAngel