Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add text per user input
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add text per user input
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 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
BRAND NEW USER -: PROBLEMS WITH LIST AND TEXT BOX INPUT | Excel Programming | |||
BRAND NEW USER -: PROBLEMS WITH LIST AND TEXT BOX INPUT | Excel Programming | |||
Excel VBA- Get user input, search the for match, output to text file | Excel Programming | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming | |||
How to get User input from Userform Text box | Excel Programming |