inserting special character in a cell as a macro
Here is a macro with choices.
Sub Add_Text()
Dim cell As Range
Dim moretext As String
Dim thisrng As Range
On Error GoTo endit
whichside = InputBox("Left = 1 or Right =2")
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants, xlTextValues)
moretext = InputBox("Enter your Text")
If whichside = 1 Then
For Each cell In thisrng
cell.Value = moretext & cell.Value
Next
Else
For Each cell In thisrng
cell.Value = cell.Value & moretext
Next
End If
Exit Sub
endit:
MsgBox "only numbers or formulas in range"
End Sub
Gord Dibben MS Excel MVP
On Mon, 11 Sep 2006 17:18:28 GMT, "johnnyboy" <u26492@uwe wrote:
I'm trying to copy 5600 items and I need to use a macro to save some time.
I have a column with numbers represented as text.
For example 01234 as text. the cell adjacent to it is a city ie. Los Angeles
I'm trying to use a macro so the first cell is #01234 - Los Angeles.
Can someone help me to figure out this macro.
|