PC Review


Reply
Thread Tools Rate Thread

Add text per user input

 
 
BlueAngel
Guest
Posts: n/a
 
      8th Mar 2010
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 With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      8th Mar 2010
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
<(E-Mail Removed)> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why lost the text input by the user? =?Utf-8?B?S2V2aW4=?= Microsoft ASP .NET 1 13th Sep 2007 07:53 AM
How would I generate text fields for user input in ASP.NET C#? =?Utf-8?B?U3RlcGhlbiBUYW5n?= Microsoft C# .NET 2 25th Aug 2005 05:05 PM
Text box to get user input Joshua Microsoft Access Getting Started 1 19th Apr 2005 04:01 PM
Re: How to get User input from Userform Text box K Microsoft Excel Programming 1 9th Sep 2003 10:08 PM
how to limit user input into the multiline text box???? cw Microsoft ASP .NET 1 27th Jun 2003 12:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:46 AM.